Skip to content

Commit

Permalink
Merge branch 'main' into merges/release/dev17.12-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinRansom authored Oct 22, 2024
2 parents 77dc1ba + 3159664 commit 94a8d3e
Show file tree
Hide file tree
Showing 106 changed files with 1,660 additions and 682 deletions.
12 changes: 6 additions & 6 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
"commands": [
"dotnet-counters"
],
"version": "8.0.460601"
"version": "8.0.547301"
},
"dotnet-dump": {
"commands": [
"dotnet-dump"
],
"version": "8.0.460601"
"version": "8.0.547301"
},
"dotnet-gcdump": {
"commands": [
"dotnet-gcdump"
],
"version": "8.0.460601"
"version": "8.0.547301"
},
"dotnet-sos": {
"commands": [
"dotnet-sos"
],
"version": "8.0.460601"
"version": "8.0.547301"
},
"dotnet-symbol": {
"commands": [
"dotnet-symbol"
],
"version": "1.0.460401"
"version": "8.0.547301"
},
"dotnet-trace": {
"commands": [
"dotnet-trace"
],
"version": "8.0.460601"
"version": "8.0.547301"
},
"fantomas": {
"commands": [
Expand Down
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* @dotnet/fsharp-team-msft
/eng/SourceBuild* @dotnet/source-build-internal
/eng/DotNetBuild.props @dotnet/product-construction
/eng/SourceBuild* @dotnet/source-build
6 changes: 6 additions & 0 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ stages:
displayName: Publish Test Results
inputs:
testResultsFormat: 'XUnit'
testRunTitle: WindowsCompressedMetadata $(_testKind)
mergeTestResults: true
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)'
continueOnError: true
Expand Down Expand Up @@ -558,7 +560,9 @@ stages:
displayName: Publish Test Results
inputs:
testResultsFormat: 'XUnit'
testRunTitle: Linux
testResultsFiles: '*.xml'
mergeTestResults: true
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
Expand Down Expand Up @@ -602,6 +606,8 @@ stages:
inputs:
testResultsFormat: 'XUnit'
testResultsFiles: '*.xml'
testRunTitle: MacOS
mergeTestResults: true
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes/.FSharp.Compiler.Service/9.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Allow access modifies to auto properties getters and setters ([Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430), [PR 16687](https://github.com/dotnet/fsharp/pull/16687), [PR 16861](https://github.com/dotnet/fsharp/pull/16861), [PR 17522](https://github.com/dotnet/fsharp/pull/17522))
* Render C# nullable-analysis attributes in tooltips ([PR #17485](https://github.com/dotnet/fsharp/pull/17485))
* Allow object expression without overrides. ([Language suggestion #632](https://github.com/fsharp/fslang-suggestions/issues/632), [PR #17387](https://github.com/dotnet/fsharp/pull/17387))
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17497)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
* Enable LanguageFeature.EnforceAttributeTargets in F# 9.0. ([Issue #17514](https://github.com/dotnet/fsharp/issues/17558), [PR #17516](https://github.com/dotnet/fsharp/pull/17558))
* Parser: better recovery for unfinished patterns ([PR #17231](https://github.com/dotnet/fsharp/pull/17231), [PR #17232](https://github.com/dotnet/fsharp/pull/17232)))
* Enable consuming generic arguments defined as `allows ref struct` in C# ([Issue #17597](https://github.com/dotnet/fsharp/issues/17597), display them in tooltips [PR #17706](https://github.com/dotnet/fsharp/pull/17706))
Expand Down
5 changes: 4 additions & 1 deletion docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* Fix extension methods support for non-reference system assemblies ([PR #17799](https://github.com/dotnet/fsharp/pull/17799))
* Ensure `frameworkTcImportsCache` mutations are thread-safe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795))
* Fix concurrency issue in `ILPreTypeDefImpl` ([PR #17812](https://github.com/dotnet/fsharp/pull/17812))
* Fix nullness inference for member val and other OO scenarios ([PR #17845](https://github.com/dotnet/fsharp/pull/17845))

### Added

* Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772))
* Support literal attribute on decimals ([PR #17769](https://github.com/dotnet/fsharp/pull/17769))

### Changed
Expand All @@ -19,5 +20,7 @@
* Better ranges for CE `return, yield, return! and yield!` error reporting. ([PR #17792](https://github.com/dotnet/fsharp/pull/17792))
* Better ranges for CE `match!`. ([PR #17789](https://github.com/dotnet/fsharp/pull/17789))
* Better ranges for CE `use` error reporting. ([PR #17811](https://github.com/dotnet/fsharp/pull/17811))
* Better ranges for `inherit` error reporting. ([PR #17879](https://github.com/dotnet/fsharp/pull/17879))
* Better ranges for `inherit` `struct` error reporting. ([PR #17886](https://github.com/dotnet/fsharp/pull/17886))

### Breaking Changes
1 change: 1 addition & 0 deletions docs/release-notes/.Language/preview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Added

* Better generic unmanaged structs handling. ([Language suggestion #692](https://github.com/fsharp/fslang-suggestions/issues/692), [PR #12154](https://github.com/dotnet/fsharp/pull/12154))
* Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772))

### Fixed

Expand Down
8 changes: 8 additions & 0 deletions docs/release-notes/.VisualStudio/17.13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Fixed

### Added
* Code fix for adding missing `seq`. ([PR #17772](https://github.com/dotnet/fsharp/pull/17772))

### Changed

### Breaking Changes
2 changes: 1 addition & 1 deletion eng/DotNetBuild.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Whenever altering this or other Source Build files, please include @dotnet/source-build-internal as a reviewer. -->
<!-- When altering this file, include @dotnet/product-construction as a reviewer. -->

<Project>

Expand Down
2 changes: 1 addition & 1 deletion eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Whenever altering this or other Source Build files, please include @dotnet/source-build-internal as a reviewer. -->
<!-- When altering this file or making other Source Build related changes, include @dotnet/source-build as a reviewer. -->
<!-- See aka.ms/dotnet/prebuilts for guidance on what pre-builts are and how to eliminate them. -->

<UsageData>
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.0-alpha.1.24459.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.0-alpha.1.24514.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>08649fed58d668737a54913f7d4c649a8da5dc6e</Sha>
<Sha>f3889ab90d78377122a3e427fe9a74c03611a4bd</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
Expand Down
29 changes: 19 additions & 10 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3322,7 +3322,7 @@ module EstablishTypeDefinitionCores =
| SynTypeDefnSimpleRepr.Record _ ->
if tycon.IsStructRecordOrUnionTycon then Some(g.system_Value_ty)
else None
| SynTypeDefnSimpleRepr.General (kind, _, slotsigs, fields, isConcrete, _, _, _) ->
| SynTypeDefnSimpleRepr.General (kind, inherits, slotsigs, fields, isConcrete, _, _, _) ->
let kind = InferTyconKind g (kind, attrs, slotsigs, fields, inSig, isConcrete, m)

match inheritedTys with
Expand All @@ -3333,15 +3333,20 @@ module EstablishTypeDefinitionCores =
| SynTypeDefnKind.Opaque | SynTypeDefnKind.Class | SynTypeDefnKind.Interface -> None
| _ -> error(InternalError("should have inferred tycon kind", m))

| [(ty, m)] ->
if not firstPass && not (match kind with SynTypeDefnKind.Class -> true | _ -> false) then
errorR (Error(FSComp.SR.tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes(), m))
CheckSuperType cenv ty m
| [(ty, m)] ->
let inheritRange =
match inherits with
| [] -> m
| (synType, _, _) :: _ -> synType.Range
if not firstPass && not (match kind with SynTypeDefnKind.Class -> true | _ -> false) then
errorR (Error(FSComp.SR.tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes(), inheritRange))
CheckSuperType cenv ty inheritRange
if isTyparTy g ty then
if firstPass then
errorR(Error(FSComp.SR.tcCannotInheritFromVariableType(), m))
errorR(Error(FSComp.SR.tcCannotInheritFromVariableType(), inheritRange))
Some g.obj_ty_noNulls // a "super" that is a variable type causes grief later
else
else

Some ty
| _ ->
error(Error(FSComp.SR.tcTypesCannotInheritFromMultipleConcreteTypes(), m))
Expand Down Expand Up @@ -3622,7 +3627,11 @@ module EstablishTypeDefinitionCores =
// Note: for a mutually recursive set we can't check this condition
// until "isSealedTy" and "isClassTy" give reliable results.
superTy |> Option.iter (fun ty ->
let m = match inherits with | [] -> m | (_, m, _) :: _ -> m
let m =
match inherits with
| [] -> m
| (synType, _, _) :: _ -> synType.Range

if isSealedTy g ty then
errorR(Error(FSComp.SR.tcCannotInheritFromSealedType(), m))
elif not (isClassTy g ty) then
Expand Down Expand Up @@ -4292,7 +4301,7 @@ module TcDeclarations =
| SynMemberDefn.AutoProperty (range=m) :: _ -> errorR(InternalError("List.takeUntil is wrong, have auto property", m))
| SynMemberDefn.ImplicitInherit (range=m) :: _ -> errorR(Error(FSComp.SR.tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit(), m))
| SynMemberDefn.LetBindings (range=m) :: _ -> errorR(Error(FSComp.SR.tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers(), m))
| SynMemberDefn.Inherit (range=m) :: _ -> errorR(Error(FSComp.SR.tcInheritDeclarationMissingArguments(), m))
| SynMemberDefn.Inherit (trivia= { InheritKeyword = m }) :: _ -> errorR(Error(FSComp.SR.tcInheritDeclarationMissingArguments(), m))
| SynMemberDefn.NestedType (range=m) :: _ -> errorR(Error(FSComp.SR.tcTypesCannotContainNestedTypes(), m))
| _ -> ()
| ds ->
Expand Down Expand Up @@ -4464,7 +4473,7 @@ module TcDeclarations =
let implements2 = members |> List.choose (function SynMemberDefn.Interface (interfaceType=ty) -> Some(ty, ty.Range) | _ -> None)
let inherits =
members |> List.choose (function
| SynMemberDefn.Inherit (ty, idOpt, m) -> Some(ty, m, idOpt)
| SynMemberDefn.Inherit (ty, idOpt, m, _) -> Some(ty, m, idOpt)
| SynMemberDefn.ImplicitInherit (ty, _, idOpt, m) -> Some(ty, m, idOpt)
| _ -> None)

Expand Down
13 changes: 12 additions & 1 deletion src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5891,6 +5891,17 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
TcForEachExpr cenv overallTy env tpenv (seqExprOnly, isFromSource, pat, synEnumExpr, synBodyExpr, m, spFor, spIn, m)

| SynExpr.ComputationExpr (hasSeqBuilder, comp, m) ->
let isIndexRange = match comp with | SynExpr.IndexRange _ -> true | _ -> false
let deprecatedPlacesWhereSeqCanBeOmitted =
cenv.g.langVersion.SupportsFeature LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted
if
deprecatedPlacesWhereSeqCanBeOmitted
&& isIndexRange
&& not hasSeqBuilder
&& not cenv.g.compilingFSharpCore
then
warning (Error(FSComp.SR.chkDeprecatePlacesWhereSeqCanBeOmitted (), m))

let env = ExitFamilyRegion env
cenv.TcSequenceExpressionEntry cenv env overallTy tpenv (hasSeqBuilder, comp) m

Expand Down Expand Up @@ -7140,7 +7151,7 @@ and CheckSuperType (cenv: cenv) ty m =
typeEquiv g ty g.system_Array_ty ||
typeEquiv g ty g.system_MulticastDelegate_ty ||
typeEquiv g ty g.system_Delegate_ty then
error(Error(FSComp.SR.tcPredefinedTypeCannotBeUsedAsSuperType(), m))
errorR(Error(FSComp.SR.tcPredefinedTypeCannotBeUsedAsSuperType(), m))

if isErasedType g ty then
errorR(Error(FSComp.SR.tcCannotInheritFromErasedType(), m))
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Driver/GraphChecking/FileContentMapping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ let visitSynMemberDefn (md: SynMemberDefn) : FileContentEntry list =
| SynMemberDefn.Interface(interfaceType, _, members, _) ->
yield! visitSynType interfaceType
yield! collectFromOption (List.collect visitSynMemberDefn) members
| SynMemberDefn.Inherit(baseType, _, _) -> yield! visitSynType baseType
| SynMemberDefn.Inherit(baseType = t) -> yield! visitSynType t
| SynMemberDefn.ValField(fieldInfo, _) -> yield! visitSynField fieldInfo
| SynMemberDefn.NestedType _ -> ()
| SynMemberDefn.AutoProperty(attributes = attributes; typeOpt = typeOpt; synExpr = synExpr) ->
Expand Down
4 changes: 3 additions & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1783,4 +1783,6 @@ featureEmptyBodiedComputationExpressions,"Support for computation expressions wi
featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters"
3871,tcAccessModifiersNotAllowedInSRTPConstraint,"Access modifiers cannot be applied to an SRTP constraint."
featureAllowObjectExpressionWithoutOverrides,"Allow object expressions without overrides"
3872,tcPartialActivePattern,"Multi-case partial active patterns are not supported. Consider using a single-case partial active pattern or a full active pattern."
3872,tcPartialActivePattern,"Multi-case partial active patterns are not supported. Consider using a single-case partial active pattern or a full active pattern."
3873,chkDeprecatePlacesWhereSeqCanBeOmitted,"This construct is deprecated. Sequence expressions should be of the form 'seq {{ ... }}'"
featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be omitted"
3 changes: 3 additions & 0 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type LanguageFeature =
| ParsedHashDirectiveArgumentNonQuotes
| EmptyBodiedComputationExpressions
| AllowObjectExpressionWithoutOverrides
| DeprecatePlacesWhereSeqCanBeOmitted

/// LanguageVersion management
type LanguageVersion(versionText) =
Expand Down Expand Up @@ -219,6 +220,7 @@ type LanguageVersion(versionText) =
LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work
LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, previewVersion
LanguageFeature.AllowObjectExpressionWithoutOverrides, previewVersion
LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, previewVersion
]

static let defaultLanguageVersion = LanguageVersion("default")
Expand Down Expand Up @@ -375,6 +377,7 @@ type LanguageVersion(versionText) =
| LanguageFeature.ParsedHashDirectiveArgumentNonQuotes -> FSComp.SR.featureParsedHashDirectiveArgumentNonString ()
| LanguageFeature.EmptyBodiedComputationExpressions -> FSComp.SR.featureEmptyBodiedComputationExpressions ()
| LanguageFeature.AllowObjectExpressionWithoutOverrides -> FSComp.SR.featureAllowObjectExpressionWithoutOverrides ()
| LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted -> FSComp.SR.featureDeprecatePlacesWhereSeqCanBeOmitted ()

/// 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 @@ -85,6 +85,7 @@ type LanguageFeature =
| ParsedHashDirectiveArgumentNonQuotes
| EmptyBodiedComputationExpressions
| AllowObjectExpressionWithoutOverrides
| DeprecatePlacesWhereSeqCanBeOmitted

/// LanguageVersion management
type LanguageVersion =
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Service/FSharpParseFileResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,
| SynMemberDefn.Interface(members = Some membs) ->
for m in membs do
yield! walkMember m
| SynMemberDefn.Inherit(_, _, m) ->
| SynMemberDefn.Inherit(range = m) ->
// can break on the "inherit" clause
yield! checkRange m
| SynMemberDefn.ImplicitInherit(_, arg, _, m) ->
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Service/ServiceParseTreeWalk.fs
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ module SyntaxTraversal =

|> pick x
| ok -> ok
| SynMemberDefn.Inherit(synType, _identOption, range) -> traverseInherit (synType, range)
| SynMemberDefn.Inherit(synType, _identOption, range, _) -> traverseInherit (synType, range)
| SynMemberDefn.ValField _ -> None
| SynMemberDefn.NestedType(synTypeDefn, _synAccessOption, _range) -> traverseSynTypeDefn path synTypeDefn

Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Service/ServiceParsedInputOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ module ParsedInput =
walkType t
|> Option.orElseWith (fun () -> members |> Option.bind (List.tryPick walkMember))

| SynMemberDefn.Inherit(t, _, _) -> walkType t
| SynMemberDefn.Inherit(baseType = t) -> walkType t

| SynMemberDefn.ValField(fieldInfo = field) -> walkField field

Expand Down Expand Up @@ -2240,7 +2240,7 @@ module ParsedInput =
| SynMemberDefn.Interface(interfaceType = t; members = members) ->
walkType t
members |> Option.iter (List.iter walkMember)
| SynMemberDefn.Inherit(t, _, _) -> walkType t
| SynMemberDefn.Inherit(baseType = t) -> walkType t
| SynMemberDefn.ValField(fieldInfo = field) -> walkField field
| SynMemberDefn.NestedType(tdef, _, _) -> walkTypeDefn tdef
| SynMemberDefn.AutoProperty(attributes = Attributes attrs; typeOpt = t; synExpr = e) ->
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/SyntaxTree/SyntaxTree.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ type SynMemberDefn =

| Interface of interfaceType: SynType * withKeyword: range option * members: SynMemberDefns option * range: range

| Inherit of baseType: SynType * asIdent: Ident option * range: range
| Inherit of baseType: SynType * asIdent: Ident option * range: range * trivia: SynMemberDefnInheritTrivia

| ValField of fieldInfo: SynField * range: range

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/SyntaxTree/SyntaxTree.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ type SynMemberDefn =
| Interface of interfaceType: SynType * withKeyword: range option * members: SynMemberDefns option * range: range

/// An 'inherit' definition within a class
| Inherit of baseType: SynType * asIdent: Ident option * range: range
| Inherit of baseType: SynType * asIdent: Ident option * range: range * trivia: SynMemberDefnInheritTrivia

/// A 'val' definition within a class
| ValField of fieldInfo: SynField * range: range
Expand Down
3 changes: 3 additions & 0 deletions src/Compiler/SyntaxTree/SyntaxTrivia.fs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ type SynMemberDefnAbstractSlotTrivia =

static member Zero = { GetSetKeywords = None }

[<NoEquality; NoComparison>]
type SynMemberDefnInheritTrivia = { InheritKeyword: range }

[<NoEquality; NoComparison>]
type SynFieldTrivia =
{
Expand Down
Loading

0 comments on commit 94a8d3e

Please sign in to comment.