Skip to content

Commit

Permalink
Merge branch 'main' into draft-scoped-nowarn
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin521 authored Aug 10, 2024
2 parents 526f14f + 97a2a75 commit c0d843f
Show file tree
Hide file tree
Showing 88 changed files with 943 additions and 1,054 deletions.
3 changes: 2 additions & 1 deletion docs/release-notes/.FSharp.Compiler.Service/9.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Optimize simple mappings in comprehensions when the body of the mapping has `let`-bindings and/or sequential expressions before a single yield. ([PR #17419](https://github.com/dotnet/fsharp/pull/17419))
* C# protected property can be assigned in F# inherit constructor call. ([Issue #13299](https://github.com/dotnet/fsharp/issues/13299), [PR #17391](https://github.com/dotnet/fsharp/pull/17391))
* MethodAccessException on equality comparison of a record with private fields. ([Issue #17447](https://github.com/dotnet/fsharp/issues/17447), [PR #17391](https://github.com/dotnet/fsharp/pull/17467))
* Compiler fails to recognise namespace in FQN with enabled GraphBasedChecking. ([Issue #17508](https://github.com/dotnet/fsharp/issues/17508), [PR #17510](https://github.com/dotnet/fsharp/pull/17510))

### Added

Expand All @@ -21,5 +22,5 @@
* Optimize metadata reading for type members and custom attributes. ([PR #17364](https://github.com/dotnet/fsharp/pull/17364))
* Enforce `AttributeTargets` on unions. ([PR #17389](https://github.com/dotnet/fsharp/pull/17389))
* Ensure that isinteractive multi-emit backing fields are not public. ([Issue #17439](https://github.com/dotnet/fsharp/issues/17438)), ([PR #17439](https://github.com/dotnet/fsharp/pull/17439))

* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
### Breaking Changes
2 changes: 2 additions & 0 deletions docs/release-notes/.FSharp.Core/9.0.100.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Fixed
* Struct UnionCase doesn't seem to be a valid target for the DefaultAugmentationAttribute ([Issue #17499](https://github.com/dotnet/fsharp/issues/17499), [PR #17502](https://github.com/dotnet/fsharp/pull/17502))

### Added

Expand All @@ -8,6 +9,7 @@
### Changed
* Change compiler default setting realsig+ when building assemblies ([Issue #17384](https://github.com/dotnet/fsharp/issues/17384), [PR #17378](https://github.com/dotnet/fsharp/pull/17385))
* Change compiler default setting for compressedMetadata ([Issue #17379](https://github.com/dotnet/fsharp/issues/17379), [PR #17383](https://github.com/dotnet/fsharp/pull/17383))
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
* Struct UnionCase doesn't seem to be a valid target for the DefaultAugmentationAttribute ([Issue #17499](https://github.com/dotnet/fsharp/issues/17499), [PR #17502](https://github.com/dotnet/fsharp/pull/17502))
### Breaking Changes

2 changes: 2 additions & 0 deletions docs/release-notes/.Language/9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

### Added

### Changed
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
1 change: 1 addition & 0 deletions docs/release-notes/.VisualStudio/17.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
### Changed

### Breaking Changes
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24405.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24408.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>2c829550b968e29389ce8392244da2b006d71301</Sha>
<Sha>60ae233c3d77f11c5fdb53e570b64d503b13ba59</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24405.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24408.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>2c829550b968e29389ce8392244da2b006d71301</Sha>
<Sha>60ae233c3d77f11c5fdb53e570b64d503b13ba59</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.23614.4">
Expand Down
2 changes: 1 addition & 1 deletion eng/common/darc-init.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
param (
$darcVersion = $null,
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16',
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20',
$verbosity = 'minimal',
$toolpath = $null
)
Expand Down
2 changes: 1 addition & 1 deletion eng/common/darc-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source="${BASH_SOURCE[0]}"
darcVersion=''
versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16'
versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20'
verbosity='minimal'

while [[ $# > 0 ]]; do
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"perl": "5.38.2.2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24405.1",
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.2",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
}
}
2 changes: 1 addition & 1 deletion src/Compiler/Driver/GraphChecking/FileContentMapping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ let visitPat (p: SynPat) : FileContentEntry list =
match p with
| NameofPat moduleNameIdent -> continuation [ visitNameofResult moduleNameIdent ]
| SynPat.Paren(pat = pat) -> visit pat continuation
| SynPat.Typed(pat = pat; targetType = t) -> visit pat (fun nodes -> nodes @ visitSynType t)
| SynPat.Typed(pat = pat; targetType = t) -> visit pat (fun nodes -> nodes @ visitSynType t |> continuation)
| SynPat.Const _ -> continuation []
| SynPat.Wild _ -> continuation []
| SynPat.Named _ -> continuation []
Expand Down
40 changes: 23 additions & 17 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ type LanguageVersion(versionText) =
static let languageVersion60 = 6.0m
static let languageVersion70 = 7.0m
static let languageVersion80 = 8.0m
static let languageVersion90 = 9.0m
static let previewVersion = 9999m // Language version when preview specified
static let defaultVersion = languageVersion80 // Language version when default specified
static let defaultVersion = languageVersion90 // Language version when default specified
static let latestVersion = defaultVersion // Language version when latest specified
static let latestMajorVersion = languageVersion80 // Language version when latestmajor specified
static let latestMajorVersion = languageVersion90 // Language version when latestmajor specified

static let validOptions = [| "preview"; "default"; "latest"; "latestmajor" |]

Expand All @@ -119,6 +120,7 @@ type LanguageVersion(versionText) =
languageVersion60
languageVersion70
languageVersion80
languageVersion90
|]

static let features =
Expand Down Expand Up @@ -195,22 +197,24 @@ type LanguageVersion(versionText) =
LanguageFeature.ExtendedFixedBindings, languageVersion80
LanguageFeature.PreferStringGetPinnableReference, languageVersion80

// F# 9.0
LanguageFeature.NullnessChecking, languageVersion90
LanguageFeature.ReuseSameFieldsInStructUnions, languageVersion90
LanguageFeature.PreferExtensionMethodOverPlainProperty, languageVersion90
LanguageFeature.WarningIndexedPropertiesGetSetSameType, languageVersion90
LanguageFeature.WarningWhenTailCallAttrOnNonRec, languageVersion90
LanguageFeature.UnionIsPropertiesVisible, languageVersion90
LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern, languageVersion90
LanguageFeature.LowerInterpolatedStringToConcat, languageVersion90
LanguageFeature.LowerIntegralRangesToFastLoops, languageVersion90
LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops, languageVersion90
LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, languageVersion90
LanguageFeature.EmptyBodiedComputationExpressions, languageVersion90

// F# preview
LanguageFeature.NullnessChecking, previewVersion
LanguageFeature.FromEndSlicing, previewVersion
LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion
LanguageFeature.ReuseSameFieldsInStructUnions, previewVersion
LanguageFeature.PreferExtensionMethodOverPlainProperty, previewVersion
LanguageFeature.WarningIndexedPropertiesGetSetSameType, previewVersion
LanguageFeature.WarningWhenTailCallAttrOnNonRec, previewVersion
LanguageFeature.UnionIsPropertiesVisible, previewVersion
LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern, previewVersion
LanguageFeature.EnforceAttributeTargets, previewVersion
LanguageFeature.LowerInterpolatedStringToConcat, previewVersion
LanguageFeature.LowerIntegralRangesToFastLoops, previewVersion
LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops, previewVersion
LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, previewVersion
LanguageFeature.EmptyBodiedComputationExpressions, previewVersion
LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509
LanguageFeature.EnforceAttributeTargets, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17514
LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work
]

static let defaultLanguageVersion = LanguageVersion("default")
Expand All @@ -232,6 +236,8 @@ type LanguageVersion(versionText) =
| "7" -> languageVersion70
| "8.0"
| "8" -> languageVersion80
| "9.0"
| "9" -> languageVersion90
| _ -> 0m

let specified = getVersionFromString versionText
Expand Down
24 changes: 15 additions & 9 deletions src/FSharp.Core/array.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2179,9 +2179,8 @@ module Array =
// Not exists $condition <==> (opposite of $condition is true forall)
exists (predicate >> not) array |> not

[<CompiledName("TryFindIndex")>]
let tryFindIndex predicate (array: _ array) =
checkNonNull "array" array
let inline tryFindIndexAux predicate (array: _ array) =
checkNonNull (nameof array) array

let pResult =
Parallel.For(
Expand All @@ -2192,16 +2191,24 @@ module Array =
pState.Break())
)

pResult.LowestBreakIteration |> Option.ofNullable |> Option.map int
pResult.LowestBreakIteration

[<CompiledName("TryFindIndex")>]
let tryFindIndex predicate (array: _ array) =
let i = tryFindIndexAux predicate array
if i.HasValue then Some (int (i.GetValueOrDefault()))
else None

[<CompiledName("TryFind")>]
let tryFind predicate (array: _ array) =
array |> tryFindIndex predicate |> Option.map (fun i -> array[i])
let i = tryFindIndexAux predicate array
if i.HasValue then Some array[int (i.GetValueOrDefault())]
else None

[<CompiledName("TryPick")>]
let tryPick chooser (array: _ array) =
checkNonNull "array" array
let allChosen = new System.Collections.Concurrent.ConcurrentDictionary<_, _>()
let allChosen = System.Collections.Concurrent.ConcurrentDictionary()

let pResult =
Parallel.For(
Expand All @@ -2215,9 +2222,8 @@ module Array =
pState.Break())
)

pResult.LowestBreakIteration
|> Option.ofNullable
|> Option.bind (fun i -> allChosen[int i])
if pResult.LowestBreakIteration.HasValue then allChosen[int (pResult.LowestBreakIteration.GetValueOrDefault())]
else None

[<CompiledName("Choose")>]
let choose chooser (array: 'T array) =
Expand Down
Loading

0 comments on commit c0d843f

Please sign in to comment.