Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions INTERNAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ Update the `insertTargetBranch` value at the bottom of `azure-pipelines.yml` in
### When VS `main` is open for insertions for preview releases of VS:

1. Create a new `release/dev*` branch (e.g., `release/dev17.4`) and initially set its HEAD commit to that of the previous release (e.g., `release/dev17.3` in this case).
2. Set the new branch to receive auto-merges from `main`, and also set the old release branch to flow into the new one. [This PR](https://github.com/dotnet/roslyn-tools/pull/1245/files) is a good example of what to do when a new `release/dev17.4` branch is created that should receive merges from both `main` and the previous release branch, `release/dev17.3`.
3. Set the packages from the new branch to flow into the correct package feeds via the `darc` tool. To do this:
```console
git checkout -b release/dev17.4
git reset --hard upstream/release/dev17.3
git push --set-upstream upstream release/dev17.4
```
3. Set the new branch to receive auto-merges from `main`, and also set the old release branch to flow into the new one. [This PR](https://github.com/dotnet/roslyn-tools/pull/1245/files) is a good example of what to do when a new `release/dev17.4` branch is created that should receive merges from both `main` and the previous release branch, `release/dev17.3`.
4. Set the packages from the new branch to flow into the correct package feeds via the `darc` tool. To do this:
1. Ensure the latest `darc` tool is installed by running `eng/common/darc-init.ps1`.
2. (only needed once) Run the command `darc authenticate`. A text file will be opened with instructions on how to populate access tokens.
3. Check the current package/channel subscriptions by running `darc get-default-channels --source-repo fsharp`. For this example, notice that the latest subscription shows the F# branch `release/dev17.3` is getting added to the `VS 17.3` channel.
Expand Down
Binary file removed a
Binary file not shown.
24 changes: 12 additions & 12 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
<!-- Versions for package groups -->
<RoslynVersion>4.4.0-3.22470.1</RoslynVersion>
<VisualStudioEditorPackagesVersion>17.4.196-preview</VisualStudioEditorPackagesVersion>
<MicrosoftVisualStudioShellPackagesVersion>17.4.0-preview-3-32916-145</MicrosoftVisualStudioShellPackagesVersion>
<VisualStudioProjectSystemPackagesVersion>17.4.342-pre</VisualStudioProjectSystemPackagesVersion>
<MicrosoftVisualStudioThreadingPackagesVersion>17.4.23-alpha</MicrosoftVisualStudioThreadingPackagesVersion>
<MicrosoftBuildOverallPackagesVersion>17.4.0</MicrosoftBuildOverallPackagesVersion>
<RoslynVersion>4.5.0-1.22520.13</RoslynVersion>
<VisualStudioEditorPackagesVersion>17.5.49-preview</VisualStudioEditorPackagesVersion>
<MicrosoftVisualStudioShellPackagesVersion>17.5.0-preview-1-33020-520</MicrosoftVisualStudioShellPackagesVersion>
<VisualStudioProjectSystemPackagesVersion>17.5.202-pre-g89e17c9f72</VisualStudioProjectSystemPackagesVersion>
<MicrosoftVisualStudioThreadingPackagesVersion>17.4.27</MicrosoftVisualStudioThreadingPackagesVersion>
<MicrosoftBuildOverallPackagesVersion>17.4.0-preview-22469-04</MicrosoftBuildOverallPackagesVersion>
<!-- Roslyn packages -->
<MicrosoftCodeAnalysisEditorFeaturesVersion>$(RoslynVersion)</MicrosoftCodeAnalysisEditorFeaturesVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextVersion>$(RoslynVersion)</MicrosoftCodeAnalysisEditorFeaturesTextVersion>
Expand All @@ -116,7 +116,7 @@
<!-- Visual Studio Shell packages -->
<MicrosoftVisualStudioInteropVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioInteropVersion>
<MicrosoftInternalVisualStudioInteropVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftInternalVisualStudioInteropVersion>
<MicrosoftVisualStudioImagingInterop140DesignTimeVersion>17.4.0-preview-3-32916-053</MicrosoftVisualStudioImagingInterop140DesignTimeVersion>
<MicrosoftVisualStudioImagingInterop140DesignTimeVersion>17.5.0-preview-1-33019-447</MicrosoftVisualStudioImagingInterop140DesignTimeVersion>
<MicrosoftVisualStudioShellInterop80Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellInterop80Version>
<MicrosoftVisualStudioShellInterop90Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellInterop90Version>
<MicrosoftVisualStudioShellInterop100Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellInterop100Version>
Expand All @@ -133,8 +133,8 @@
<MicrosoftVisualStudioShellDesignVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellDesignVersion>
<MicrosoftVisualStudioShellFrameworkVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellFrameworkVersion>
<MicrosoftVisualStudioPackageLanguageService150Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioPackageLanguageService150Version>
<MicrosoftVisualStudioManagedInterfacesVersion>17.4.0-preview-3-32916-053</MicrosoftVisualStudioManagedInterfacesVersion>
<MicrosoftVisualStudioProjectAggregatorVersion>17.4.0-preview-3-32916-053</MicrosoftVisualStudioProjectAggregatorVersion>
<MicrosoftVisualStudioManagedInterfacesVersion>17.5.0-preview-1-33019-447</MicrosoftVisualStudioManagedInterfacesVersion>
<MicrosoftVisualStudioProjectAggregatorVersion>17.5.0-preview-1-33019-447</MicrosoftVisualStudioProjectAggregatorVersion>
<MicrosoftVisualStudioGraphModelVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioGraphModelVersion>
<MicrosoftVisualStudioImagingVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioImagingVersion>
<MicrosoftVisualStudioDesignerInterfacesVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioDesignerInterfacesVersion>
Expand Down Expand Up @@ -171,7 +171,7 @@
<MicrosoftVisualStudioProjectSystemManagedVersion>2.3.6152103</MicrosoftVisualStudioProjectSystemManagedVersion>
<!-- Misc. Visual Studio packages -->
<MicrosoftVSSDKBuildToolsVersion>17.1.4054</MicrosoftVSSDKBuildToolsVersion>
<MicrosoftVisualStudioRpcContractsVersion>17.4.7-alpha</MicrosoftVisualStudioRpcContractsVersion>
<MicrosoftVisualStudioRpcContractsVersion>17.5.9-alpha-g84529e7115</MicrosoftVisualStudioRpcContractsVersion>
<MicrosoftVisualFSharpMicrosoftVisualStudioShellUIInternalVersion>17.0.0</MicrosoftVisualFSharpMicrosoftVisualStudioShellUIInternalVersion>
<MicrosoftVisualStudioValidationVersion>17.0.64</MicrosoftVisualStudioValidationVersion>
<MicrosoftVisualStudioWCFReferenceInteropVersion>9.0.30729</MicrosoftVisualStudioWCFReferenceInteropVersion>
Expand Down Expand Up @@ -204,8 +204,8 @@
<NUnitLiteVersion>3.11.0</NUnitLiteVersion>
<NunitXmlTestLoggerVersion>2.1.80</NunitXmlTestLoggerVersion>
<RoslynToolsSignToolVersion>1.0.0-beta2-dev3</RoslynToolsSignToolVersion>
<StreamJsonRpcVersion>2.13.23-alpha</StreamJsonRpcVersion>
<NerdbankStreamsVersion>2.9.87-alpha</NerdbankStreamsVersion>
<StreamJsonRpcVersion>2.14.6-alpha</StreamJsonRpcVersion>
<NerdbankStreamsVersion>2.9.112</NerdbankStreamsVersion>
<XUnitVersion>2.4.1</XUnitVersion>
<XUnitRunnerVersion>2.4.2</XUnitRunnerVersion>
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
Expand Down
29 changes: 24 additions & 5 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,19 @@ module MutRecBindingChecking =

defnsEs, envMutRec

let private ReportErrorOnStaticClass (synMembers: SynMemberDefn list) =
for mem in synMembers do
match mem with
| SynMemberDefn.ImplicitCtor(ctorArgs = SynSimplePats.SimplePats(pats = pats)) when (not pats.IsEmpty) ->
for pat in pats do
errorR(Error(FSComp.SR.chkConstructorWithArgumentsOnStaticClasses(), pat.Range))

| SynMemberDefn.Member(SynBinding(valData = SynValData(memberFlags = Some memberFlags)), m) when memberFlags.MemberKind = SynMemberKind.Constructor ->
errorR(Error(FSComp.SR.chkAdditionalConstructorOnStaticClasses(), m))
| SynMemberDefn.Member(SynBinding(valData = SynValData(memberFlags = Some memberFlags)), m) when memberFlags.MemberKind = SynMemberKind.Member && memberFlags.IsInstance ->
errorR(Error(FSComp.SR.chkInstanceMemberOnStaticClasses(), m));
| _ -> ()

/// Check and generalize the interface implementations, members, 'let' definitions in a mutually recursive group of definitions.
let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (envMutRec: TcEnv) (mutRecDefns: MutRecDefnsPhase2Data) isMutRec =
let g = cenv.g
Expand Down Expand Up @@ -1755,7 +1768,13 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (env

let binds: MutRecDefnsPhase2Info =
(envMutRec, mutRecDefns) ||> MutRecShapes.mapTyconsWithEnv (fun envForDecls tyconData ->
let (MutRecDefnsPhase2DataForTycon(tyconOpt, _, declKind, tcref, _, _, declaredTyconTypars, _, _, _, fixupFinalAttrs)) = tyconData
let (MutRecDefnsPhase2DataForTycon(tyconOpt, _x, declKind, tcref, _, _, declaredTyconTypars, synMembers, _, _, fixupFinalAttrs)) = tyconData

// If a tye uses both [<Sealed>] and [<AbstractClass>] attributes it means it is a static class.
let isStaticClass = HasFSharpAttribute cenv.g cenv.g.attrib_SealedAttribute tcref.Attribs && HasFSharpAttribute cenv.g cenv.g.attrib_AbstractClassAttribute tcref.Attribs
if isStaticClass && cenv.g.langVersion.SupportsFeature(LanguageFeature.ErrorReportingOnStaticClasses) then
ReportErrorOnStaticClass synMembers

let envForDecls =
// This allows to implement protected interface methods if it's a DIM.
// Does not need to be hidden behind a lang version as it needs to be possible to
Expand Down Expand Up @@ -4030,6 +4049,7 @@ module TcDeclarations =
let rec private SplitTyconDefn (SynTypeDefn(typeInfo=synTyconInfo;typeRepr=trepr; members=extraMembers)) =
let extraMembers = desugarGetSetMembers extraMembers
let implements1 = List.choose (function SynMemberDefn.Interface (interfaceType=ty) -> Some(ty, ty.Range) | _ -> None) extraMembers

match trepr with
| SynTypeDefnRepr.ObjectModel(kind, cspec, m) ->
let cspec = desugarGetSetMembers cspec
Expand All @@ -4047,7 +4067,7 @@ module TcDeclarations =
let members =
let membersIncludingAutoProps =
cspec |> List.filter (fun memb ->
match memb with
match memb with
| SynMemberDefn.Interface _
| SynMemberDefn.Member _
| SynMemberDefn.GetSetMember _
Expand Down Expand Up @@ -4837,7 +4857,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
let moduleEntity = Construct.NewModuleOrNamespace (Some env.eCompPath) vis id xmlDoc modAttrs (MaybeLazy.Strict moduleTy)

// Now typecheck.
let! moduleContents, topAttrsNew, envAtEnd = TcModuleOrNamespaceElements cenv (Parent (mkLocalModuleRef moduleEntity)) endm envForModule xml None [] moduleDefs
let! moduleContents, topAttrsNew, envAtEnd = TcModuleOrNamespaceElements cenv (Parent (mkLocalModuleRef moduleEntity)) endm envForModule xml None [] moduleDefs

// Get the inferred type of the decls and record it in the modul.
moduleEntity.entity_modul_type <- MaybeLazy.Strict moduleTyAcc.Value
Expand Down Expand Up @@ -4924,8 +4944,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem

let! moduleContents, topAttrs, envAtEnd = TcModuleOrNamespaceElements cenv parent endm envNS xml mutRecNSInfo [] defs

MutRecBindingChecking.TcMutRecDefns_UpdateNSContents nsInfo

MutRecBindingChecking.TcMutRecDefns_UpdateNSContents nsInfo
let env, openDecls =
if isNil enclosingNamespacePath then
envAtEnd, []
Expand Down
6 changes: 5 additions & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,7 @@ featureCSharpExtensionAttributeNotRequired,"Allow implicit Extension attribute o
featureErrorForNonVirtualMembersOverrides,"Raises errors for non-virtual members overrides"
featureWarningWhenInliningMethodImplNoInlineMarkedFunction,"Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined."
featureArithmeticInLiterals,"Allow arithmetic and logical operations in literals"
featureErrorReportingOnStaticClasses,"Error reporting on static classes"
3353,fsiInvalidDirective,"Invalid directive '#%s %s'"
3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
Expand Down Expand Up @@ -1663,5 +1664,8 @@ reprStateMachineInvalidForm,"The state machine has an unexpected form"
3548,matchNotAllowedForUnionCaseWithNoData,"Pattern discard is not allowed for union case that takes no data."
3549,tcSynTypeOrInvalidInDeclaration,"SynType.Or is not permitted in this declaration"
3550,chkDuplicatedMethodParameter,"Duplicate parameter. The parameter '%s' has been used more that once in this method."
featureEscapeBracesInFormattableString,"Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString"
3551,buildDuplicateFile,"The source file '%s' (at position %d/%d) already appeared in the compilation list (at position %d/%d). Please verify that it is included only once in the project file."
featureEscapeBracesInFormattableString,"Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString"
3552,chkConstructorWithArgumentsOnStaticClasses,"If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed."
3553,chkAdditionalConstructorOnStaticClasses,"If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed."
3554,chkInstanceMemberOnStaticClasses,"If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed."
5 changes: 4 additions & 1 deletion src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ type LanguageFeature =
| WarningWhenInliningMethodImplNoInlineMarkedFunction
| EscapeDotnetFormattableStrings
| ArithmeticInLiterals

| ErrorReportingOnStaticClasses

/// LanguageVersion management
type LanguageVersion(versionText) =

Expand Down Expand Up @@ -136,6 +137,7 @@ type LanguageVersion(versionText) =
LanguageFeature.WarningWhenInliningMethodImplNoInlineMarkedFunction, previewVersion
LanguageFeature.EscapeDotnetFormattableStrings, previewVersion
LanguageFeature.ArithmeticInLiterals, previewVersion
LanguageFeature.ErrorReportingOnStaticClasses, previewVersion

]

Expand Down Expand Up @@ -249,6 +251,7 @@ type LanguageVersion(versionText) =
| LanguageFeature.WarningWhenInliningMethodImplNoInlineMarkedFunction -> FSComp.SR.featureWarningWhenInliningMethodImplNoInlineMarkedFunction ()
| LanguageFeature.EscapeDotnetFormattableStrings -> FSComp.SR.featureEscapeBracesInFormattableString ()
| LanguageFeature.ArithmeticInLiterals -> FSComp.SR.featureArithmeticInLiterals ()
| LanguageFeature.ErrorReportingOnStaticClasses -> FSComp.SR.featureErrorReportingOnStaticClasses ()

/// Get a version string associated with the given feature.
static member GetFeatureVersionString feature =
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type LanguageFeature =
| WarningWhenInliningMethodImplNoInlineMarkedFunction
| EscapeDotnetFormattableStrings
| ArithmeticInLiterals
| ErrorReportingOnStaticClasses

/// LanguageVersion management
type LanguageVersion =
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Symbols/Symbols.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) =
if isUnresolved() then false else
match fsharpInfo() with
| None -> false
| Some v ->
| Some v ->
v.IsCompilerGenerated

member _.InlineAnnotation =
Expand Down
20 changes: 20 additions & 0 deletions src/Compiler/xlf/FSComp.txt.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
<target state="translated">Soubor {0} má nerozpoznanou příponu. Zdrojové soubory musí mít příponu .fs, .fsi, .fsx nebo .fsscript.</target>
<note />
</trans-unit>
<trans-unit id="chkAdditionalConstructorOnStaticClasses">
<source>If a type uses both [&lt;Sealed&gt;] and [&lt;AbstractClass&gt;] attributes, it means it is static. Additional constructor is not allowed.</source>
<target state="new">If a type uses both [&lt;Sealed&gt;] and [&lt;AbstractClass&gt;] attributes, it means it is static. Additional constructor is not allowed.</target>
<note />
</trans-unit>
<trans-unit id="chkConstructorWithArgumentsOnStaticClasses">
<source>If a type uses both [&lt;Sealed&gt;] and [&lt;AbstractClass&gt;] attributes, it means it is static. Constructor with arguments is not allowed.</source>
<target state="new">If a type uses both [&lt;Sealed&gt;] and [&lt;AbstractClass&gt;] attributes, it means it is static. Constructor with arguments is not allowed.</target>
<note />
</trans-unit>
<trans-unit id="chkDuplicatedMethodParameter">
<source>Duplicate parameter. The parameter '{0}' has been used more that once in this method.</source>
<target state="translated">Duplicitní parametr Parametr {0} byl v této metodě použit vícekrát.</target>
Expand Down Expand Up @@ -62,6 +72,11 @@
<target state="translated">Použití incr z knihovny F# je zastaralé. Více informací: https://aka.ms/fsharp-refcell-ops. Změňte prosím například incr cell na cell.Value &lt;- cell.Value + 1.</target>
<note />
</trans-unit>
<trans-unit id="chkInstanceMemberOnStaticClasses">
<source>If a type uses both [&lt;Sealed&gt;] and [&lt;AbstractClass&gt;] attributes, it means it is static. Instance members are not allowed.</source>
<target state="new">If a type uses both [&lt;Sealed&gt;] and [&lt;AbstractClass&gt;] attributes, it means it is static. Instance members are not allowed.</target>
<note />
</trans-unit>
<trans-unit id="containerDeprecated">
<source>The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead.</source>
<target state="translated">Atribut AssemblyKeyNameAttribute je zastaralý. Použijte místo něj AssemblyKeyFileAttribute.</target>
Expand Down Expand Up @@ -197,6 +212,11 @@
<target state="translated">chyba při zastaralém přístupu konstruktoru s atributem RequireQualifiedAccess</target>
<note />
</trans-unit>
<trans-unit id="featureErrorReportingOnStaticClasses">
<source>Error reporting on static classes</source>
<target state="new">Error reporting on static classes</target>
<note />
</trans-unit>
<trans-unit id="featureEscapeBracesInFormattableString">
<source>Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString</source>
<target state="translated">Uvede složené závorky před voláním formattableStringFactory.Create, pokud je interpolovaný řetězcový literál zadán jako FormattableString.</target>
Expand Down
Loading