Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5899b74
feat(FSharp.Core): add pinned FSharpCoreShippedNetTargetFramework kno…
T-Gro Aug 6, 2026
b216325
feat(FSharp.Core): compile net10.0 target
T-Gro Aug 6, 2026
533083c
feat(FSharp.Core): pack lib/net10.0 into the shipped nupkg
T-Gro Aug 6, 2026
bdf1161
test(FSharp.Core): add dedicated net SurfaceArea baseline
T-Gro Aug 6, 2026
2f0adaf
test(FSharp.Core): assembly-level ApiCompat net-vs-ns2.1 identity gate
T-Gro Aug 6, 2026
786897d
build(FSharp.Core): add TFM #if guard audit (the #ifdef-management ask)
T-Gro Aug 6, 2026
8dff8f5
test(FSharp.Core): e2e-1 nupkg-contents + AssemblyVersion-equality ve…
Copilot Aug 6, 2026
2aab488
test(FSharp.Core): e2e-2 net-TFM consumer asset-resolution witness
Copilot Aug 6, 2026
cbd9640
test(FSharp.Core): e2e-5 net-TFM trimming + NativeAOT consumer legs
Copilot Aug 6, 2026
22e8de6
ci(FSharp.Core): wire e2e-1 nupkg verify + e2e-2 resolution witness i…
Copilot Aug 6, 2026
6c1b1bd
docs(release-notes): FSharp.Core net10.0 target framework entry
Copilot Aug 6, 2026
2bb06af
docs(release-notes): fill PR #20224 into FSharp.Core net10.0 entry
Copilot Aug 6, 2026
9c0fc9a
docs(release-notes): point net10.0 entry at PR #20229
Copilot Aug 7, 2026
e4b80c5
Merge remote-tracking branch 'origin/main' into t-gro-fsharpcore-net1…
Copilot Aug 7, 2026
944f220
test(FSharp.Core): refresh net SurfaceArea baselines for Async.RunSyn…
Copilot Aug 7, 2026
efa1b50
refactor(FSharp.Core): trim narration comments in net10.0 TFM scaffol…
Copilot Aug 7, 2026
dc2b916
refactor(tests): tighten e2e-2 consumer comments (NoBloat round 2)
Copilot Aug 7, 2026
17fc005
Compaction round 1: drop dangling plan ref + phase tag
Copilot Aug 7, 2026
f3c4ef3
Compaction round 2: dedup e2e-1 asserts, harden gates, drop dead ns2.…
Copilot Aug 7, 2026
74494f5
ci(FSharp.Core): relocate e2e-2 resolution witness to EndToEndBuildTe…
Copilot Aug 7, 2026
1db6100
harden(net10 pin): clear error on malformed pin TFM + fail-closed e2e…
Copilot Aug 7, 2026
021d62c
fix(FSharp.Core): keep in-repo consumers on netstandard2.1 (net10.0 i…
Copilot Aug 7, 2026
820e491
fix(test): e2e-2 resolves FSharp.Core from the packages root, not a f…
Copilot Aug 7, 2026
2428ddc
fix(test): e2e-2 stages FSharp.Core into a flat local feed for determ…
Copilot Aug 7, 2026
efa90d5
fix(tests): pin FSharp.Compiler.Service.Tests to netstandard2.1 FShar…
Copilot Aug 10, 2026
aeb0a00
test(FSharp.Core): compact net10.0 e2e scaffolding
Copilot Aug 10, 2026
7abba78
fix(build): handle FSharp.Core net pin under source-build
Copilot Aug 10, 2026
555e7f1
test(ilverify): cover the shipped net FSharp.Core leg
Copilot Aug 10, 2026
7a20d3a
test(e2e): prove net-leg fallback resolution, not just exact match
Copilot Aug 10, 2026
d0277a2
test(e2e): replace pack-and-consume project with a compact package check
Copilot Aug 11, 2026
e816351
test(compaction): trim narration + fail-fast package check
Copilot Aug 11, 2026
7153c6e
fix(FSharp.Core): compile net-current leg; simplify shipped-net pin
Copilot Aug 11, 2026
642b87a
simplify(FSharp.Core): drop net10 scaffolding; let consumers bind net10
Copilot Aug 11, 2026
05b7a8b
fix: restore the load-bearing netstandard2.1 pin for in-repo consumers
Copilot Aug 11, 2026
b58dfd6
Merge branch 'main' into t-gro-fsharpcore-net10-tfm-plan
T-Gro Aug 12, 2026
c038195
Fix net10 E2E compiler and coverage
T-Gro Aug 13, 2026
8ace798
Merge remote-tracking branch 'origin/main' into pr/20229/t-gro-fsharp…
T-Gro Aug 13, 2026
e6903f1
Include Async ValueTask APIs in net10 FSharp.Core
T-Gro Aug 13, 2026
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
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
Cannot live in eng/TargetFrameworks.props because it's imported before Arcade. -->
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<FSharpNetCoreProductTargetFramework>$(NetCurrent)</FSharpNetCoreProductTargetFramework>
<!-- Source-build targets only $(NetCurrent); collapse the shipped-net pin to it (its ref pack is always present). -->
<FSharpCoreShippedNetTargetFramework>$(NetCurrent)</FSharpCoreShippedNetTargetFramework>
</PropertyGroup>

<!-- It's important we set TFM before this, since FSharpTests.Directory.Build.props uses it.
Expand Down
7 changes: 7 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>

<!-- net10.0 ships in the FSharp.Core package only; in-repo .NET consumers keep binding netstandard2.1. -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(Configuration)' != 'Proto'">
<ProjectReference Update="@(ProjectReference)">
<SetTargetFramework Condition="'%(ProjectReference.Filename)' == 'FSharp.Core' and '%(ProjectReference.SetTargetFramework)' == ''">TargetFramework=netstandard2.1</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<!-- Disable R2R when building source-only and not targeting the current SDK bundled TFM. -->
<PropertyGroup>
<PublishReadyToRun Condition="'$(DotNetBuildSourceOnly)' == 'true' and
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ stages:
- script: .\Build.cmd -c Release -pack
env:
NativeToolsOnMachine: true
- script: .\eng\common\dotnet.cmd fsi .\tests\AheadOfTime\NetPackage\VerifyNetPackage.fsx -- .\artifacts\packages\Release
displayName: Verify FSharp.Core package assets
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release
displayName: End to end build tests

Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/11.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* Fix internal compiler error FS1110 in `task { let! }` (and other computation expressions) when a generic IL extension method whose `this`-parameter is a method-level type variable is in scope (e.g. `open ReactiveUI`). Regression from PR #19536. ([Issue #19936](https://github.com/dotnet/fsharp/issues/19936))
* Fix inner mutually-recursive `let rec ... and ...` functions under `--realsig+` not being lifted to top-level static methods (TLR), causing `FSharpFunc` closure allocations and loss of `tail.` opcodes — the large struct-mutual-recursion perf regression reported in [Issue #17607](https://github.com/dotnet/fsharp/issues/17607). ([PR #19882](https://github.com/dotnet/fsharp/pull/19882))
* Fix `TypeLoadException` ("Specialize tried to implicitly override a method with weaker type parameter constraints") and the related CLR crash with constrained inline calls by stripping constraints from closure-class typars in `EraseClosures.convIlxClosureDef`. ([Issue #14492](https://github.com/dotnet/fsharp/issues/14492), [Issue #19075](https://github.com/dotnet/fsharp/issues/19075), [PR #19882](https://github.com/dotnet/fsharp/pull/19882))
* Fix FS0073 during code generation when closure generic arguments contain an unsolved type variable. ([PR #20229](https://github.com/dotnet/fsharp/pull/20229))
* Fix `FieldAccessException` at runtime when the optimizer relocates a read of a `protected` (family) base-class field into a method outside the field's family (e.g. a trivial member inlined into module/startup code under `--optimize+`). Protected (family) IL field access is no longer hoisted out of its declaring family by inlining or method-splitting. ([Issue #19963](https://github.com/dotnet/fsharp/issues/19963), [PR #19964](https://github.com/dotnet/fsharp/pull/19964))

* Suppress hover/symbol resolution for wildcard `_` patterns inside `member _.…` bodies that incorrectly showed `val _: T` tooltip. ([PR #19760](https://github.com/dotnet/fsharp/pull/19760))
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Core/11.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### Added

* Ship `FSharp.Core` with an additional `net10.0` target framework (next to `netstandard2.0` and `netstandard2.1`). The `net`-TFM assembly is public-surface-identical to the `netstandard2.1` one; the target version is a pinned, deliberately advanced knob. ([PR #20229](https://github.com/dotnet/fsharp/pull/20229))
* Add `Async.Await`, mirroring `Async.AwaitTask` semantics, but elides egregious `AggregateException` wrapping. Includes `ValueTask` support, and a SRTP-based overload accepting any Task-like value that supports the `GetAwaiter` protocol. ([Language Suggestion #840](https://github.com/fsharp/fslang-suggestions/issues/840), [PR #19785](https://github.com/dotnet/fsharp/pull/19785))
* `Async.RunSynchronouslyImmediate`: runs work on the calling thread until the first asynchronous suspension (as opposed to `RunSynchronously`, which immediately offloads if not on a background and/or threadpool thread). ([Issue #1042](https://github.com/fsharp/fslang-suggestions/issues/1042), [PR #19804](https://github.com/dotnet/fsharp/pull/19804))
* Added modules for `Async`, `Task` and `ValueTask` with consistent `result`, `map`, `bind`, `ignore`, `catchWith`, `catch`, and `empty` functions ([LanguageSuggestion #1466](https://github.com/fsharp/fslang-suggestions/issues/1466), [PR #19844](https://github.com/dotnet/fsharp/pull/19844))
Expand Down
3 changes: 3 additions & 0 deletions eng/TargetFrameworks.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

<!-- Derive major version by stripping 'net' prefix and '.0' suffix (e.g., net10.0 -> 10) -->
<FSharpNetCoreProductMajorVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(FSharpNetCoreProductTargetFramework)', '^net(\d+)\.0$', '$1'))</FSharpNetCoreProductMajorVersion>

<!-- Net TFM shipped in the FSharp.Core NuGet package. Lags the in-dev product TFM; bump deliberately. -->
<FSharpCoreShippedNetTargetFramework Condition="'$(FSharpCoreShippedNetTargetFramework)' == ''">net10.0</FSharpCoreShippedNetTargetFramework>
</PropertyGroup>

</Project>
12 changes: 7 additions & 5 deletions src/Compiler/CodeGen/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6833,7 +6833,7 @@ and GenSequenceExpr
let cloref = IlxClosureRef(ilCloTypeRef, ilCloLambdas, ilCloAllFreeVars)

let ilxCloSpec =
IlxClosureSpec.Create(cloref, GenGenericArgs m eenvouter.tyenv cloFreeTyvars, false)
IlxClosureSpec.Create(cloref, GenGenericArgs cenv m eenvouter.tyenv cloFreeTyvars, false)

let formalClospec =
IlxClosureSpec.Create(cloref, mkILFormalGenericArgs 0 ilCloGenericParams, false)
Expand Down Expand Up @@ -7075,8 +7075,10 @@ and GenStaticDelegateClosureTypeDefs
and GenGenericParams cenv eenv tps =
tps |> DropErasedTypars |> List.map (GenGenericParam cenv eenv)

and GenGenericArgs m (tyenv: TypeReprEnv) tps =
tps |> DropErasedTypars |> List.map (fun c -> (mkILTyvarTy tyenv[c, m]))
and GenGenericArgs cenv m (tyenv: TypeReprEnv) tps =
tps
|> DropErasedTypars
|> List.map (fun tp -> GenType cenv m tyenv (mkTyparTy tp))

/// Generate a local type function contract class and implementation
and GenClosureAsLocalTypeFunction cenv (cgbuf: CodeGenBuffer) eenv thisVars expr m =
Expand Down Expand Up @@ -7476,7 +7478,7 @@ and GetIlxClosureInfo cenv m boxity isLocalTypeFunc canUseStaticField thisVars e

/// Compute the contract if it is a local type function
let ilCloGenericFormals = GenGenericParams cenv eenvinner cloFreeTyvars
let ilCloGenericActuals = GenGenericArgs m eenvouter.tyenv cloFreeTyvars
let ilCloGenericActuals = GenGenericArgs cenv m eenvouter.tyenv cloFreeTyvars

let useStaticField = canUseStaticField && (ilCloAllFreeVars.Length = 0)

Expand Down Expand Up @@ -7784,7 +7786,7 @@ and GenDelegateExpr cenv cgbuf eenvouter expr (TObjExprMethod(slotsig, _attribs,
CountClosure()

// Push the constructor for the delegee
let ctxtGenericArgsForDelegee = GenGenericArgs m eenvouter.tyenv cloFreeTyvars
let ctxtGenericArgsForDelegee = GenGenericArgs cenv m eenvouter.tyenv cloFreeTyvars

if useStaticClosure then
GenUnit cenv eenvouter m cgbuf
Expand Down
7 changes: 6 additions & 1 deletion src/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks Condition="'$(Configuration)' == 'Proto'">netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(Configuration)' != 'Proto'">netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(Configuration)' != 'Proto'">netstandard2.0;netstandard2.1;$(FSharpCoreShippedNetTargetFramework)</TargetFrameworks>
<NoWarn>$(NoWarn);75</NoWarn> <!-- InternalCommandLineOption -->
<NoWarn>$(NoWarn);1204</NoWarn> <!-- This construct is for use in the FSharp.Core library and should not be used directly -->
<AllowCrossTargeting>true</AllowCrossTargeting>
Expand Down Expand Up @@ -36,6 +36,11 @@
<Configurations>Debug;Release;Proto</Configurations>
</PropertyGroup>

<!-- Surface the shipped-net pin to FSharp.Core.nuspec as a $token$. -->
<ItemGroup Condition="'$(Configuration)' != 'Proto'">
<NuspecProperty Include="FSharpCoreShippedNetTargetFramework=$(FSharpCoreShippedNetTargetFramework)" />
</ItemGroup>

<!-- .FSharp.Core always uses the old style initialization mechanism because of SQL CLR requirements -->
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'true' and '$(Configuration)' != 'Proto'">
<OtherFlags>$(OtherFlags) --realsig-</OtherFlags>
Expand Down
7 changes: 7 additions & 0 deletions src/FSharp.Core/FSharp.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<dependencies>
<group targetFramework=".NETStandard2.0" />
<group targetFramework=".NETStandard2.1" />
<group targetFramework="$FSharpCoreShippedNetTargetFramework$" />
</dependencies>
</metadata>
<files>
Expand All @@ -22,5 +23,11 @@

<!-- resources -->
<file src="FSharp.Core\$Configuration$\netstandard2.1\**\FSharp.Core.resources.dll" target="lib\netstandard2.1" />

<file src="FSharp.Core\$Configuration$\$FSharpCoreShippedNetTargetFramework$\FSharp.Core.dll" target="lib\$FSharpCoreShippedNetTargetFramework$" />
<file src="FSharp.Core\$Configuration$\$FSharpCoreShippedNetTargetFramework$\FSharp.Core.xml" target="lib\$FSharpCoreShippedNetTargetFramework$" />

<!-- resources -->
<file src="FSharp.Core\$Configuration$\$FSharpCoreShippedNetTargetFramework$\**\FSharp.Core.resources.dll" target="lib\$FSharpCoreShippedNetTargetFramework$" />
</files>
</package>
14 changes: 7 additions & 7 deletions src/FSharp.Core/Query.fs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ type QueryBuilder() =
member _.Head (source: QuerySource<'T, 'Q>) =
Enumerable.First source.Source

member _.Nth (source: QuerySource<'T, 'Q>, index) =
member _.Nth (source: QuerySource<'T, 'Q>, index: int) =
Enumerable.ElementAt (source.Source, index)

member _.Skip (source: QuerySource<'T, 'Q>, count) : QuerySource<'T, 'Q> =
Expand All @@ -116,7 +116,7 @@ type QueryBuilder() =
member _.SkipWhile (source: QuerySource<'T, 'Q>, predicate) : QuerySource<'T, 'Q> =
QuerySource (Enumerable.SkipWhile (source.Source, Func<_, _>(predicate)))

member _.Take (source: QuerySource<'T, 'Q>, count) : QuerySource<'T, 'Q> =
member _.Take (source: QuerySource<'T, 'Q>, count: int) : QuerySource<'T, 'Q> =
QuerySource (Enumerable.Take (source.Source, count))

member _.TakeWhile (source: QuerySource<'T, 'Q>, predicate) : QuerySource<'T, 'Q> =
Expand Down Expand Up @@ -246,7 +246,7 @@ type QueryBuilder() =
QuerySource (Enumerable.GroupJoin(outerSource.Source, innerSource.Source, Func<_, _>(outerKeySelector), Func<_, _>(innerKeySelector), Func<_, _, _>(resultSelector)))

member _.LeftOuterJoin (outerSource: QuerySource<_, 'Q>, innerSource: QuerySource<_, 'Q>, outerKeySelector, innerKeySelector, resultSelector: _ -> seq<_> -> _) : QuerySource<_, 'Q> =
QuerySource (Enumerable.GroupJoin(outerSource.Source, innerSource.Source, Func<_, _>(outerKeySelector), Func<_, _>(innerKeySelector), Func<_, _, _>(fun x g -> resultSelector x (g.DefaultIfEmpty()))))
QuerySource (Enumerable.GroupJoin(outerSource.Source, innerSource.Source, Func<_, _>(outerKeySelector), Func<_, _>(innerKeySelector), Func<_, _, _>(fun x (g: seq<_>) -> resultSelector x (g.DefaultIfEmpty()))))

member _.RunQueryAsValue (q: Quotations.Expr<'T>) : 'T =
ForwardDeclarations.Query.Execute q
Expand Down Expand Up @@ -475,8 +475,8 @@ module Query =
MakeOrCallContainsOrElementAt FQ FE

let MakeElementAt, CallElementAt =
let FQ = methodhandleof (fun (x, y) -> Queryable.ElementAt(x, y))
let FE = methodhandleof (fun (x, y) -> Enumerable.ElementAt(x, y))
let FQ = methodhandleof (fun (x, y) -> Queryable.ElementAt(x, (y: int)))
let FE = methodhandleof (fun (x, y) -> Enumerable.ElementAt(x, (y: int)))
MakeOrCallContainsOrElementAt FQ FE

let MakeOrCallMinByOrMaxBy FQ FE =
Expand Down Expand Up @@ -886,8 +886,8 @@ module Query =

let MakeTake =
MakeSkipOrTake
(methodhandleof (fun (x, y) -> Queryable.Take (x, y)))
(methodhandleof (fun (x, y) -> Enumerable.Take (x, y)))
(methodhandleof (fun (x, y) -> Queryable.Take (x, (y: int))))
(methodhandleof (fun (x, y) -> Enumerable.Take (x, (y: int))))

let MakeSkipWhile =
GenMakeSkipWhileOrTakeWhile
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Core/async.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2254,7 +2254,7 @@ type Async =
static member Await(task: Task) : Async<unit> =
AwaitUnitTask true task

#if NETSTANDARD2_1
#if NETSTANDARD2_1 || NET
static member Await(task: ValueTask<'T>) : Async<'T> =
if task.IsCompletedSuccessfully then
CreateReturnAsync(task.GetAwaiter().GetResult())
Expand Down
7 changes: 3 additions & 4 deletions src/FSharp.Core/async.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ namespace Microsoft.FSharp.Control
/// </example>
static member Await: task: Task -> Async<unit>

#if NETSTANDARD2_1
#if NETSTANDARD2_1 || NET
/// <summary>Creates an asynchronous computation that will wait for the given <c>ValueTask</c> to complete and return
/// its result.</summary>
/// <param name="task">The <c>ValueTask</c> to await.</param>
Expand Down Expand Up @@ -1291,13 +1291,13 @@ namespace Microsoft.FSharp.Control
/// with <c>IsCompleted</c> and <c>GetResult()</c> members.</p>
/// <p>Exceptions thrown by <c>GetResult()</c> are propagated directly.</p>
/// <p>Unlike the <see cref="T:System.Threading.Tasks.Task"/>
#if NETSTANDARD2_1
#if NETSTANDARD2_1 || NET
/// and <see cref="T:System.Threading.Tasks.ValueTask"/>
#endif
/// overloads, an <see cref="T:System.AggregateException"/> carrying multiple inner exceptions is not preserved:
/// the first inner exception surfaces (standard <c>GetResult()</c> semantics).</p>
/// <p>This overload uses statically resolved type parameters (SRTP) so it can accept any task-like type.
#if NETSTANDARD2_1
#if NETSTANDARD2_1 || NET
/// The specific overloads for <see cref="T:System.Threading.Tasks.Task`1"/>, <see cref="T:System.Threading.Tasks.Task"/>,
/// <see cref="T:System.Threading.Tasks.ValueTask`1"/> and <see cref="T:System.Threading.Tasks.ValueTask"/>
#else
Expand Down Expand Up @@ -1931,4 +1931,3 @@ namespace Microsoft.FSharp.Control
/// </example>
[<CompiledName("Empty")>]
val empty: Async<unit>

6 changes: 3 additions & 3 deletions src/FSharp.Core/local.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ module internal DetailedExceptions =
open Microsoft.FSharp.Core

/// takes an argument, a formatting string, a param array to splice into the formatting string
let inline invalidArgFmt (arg:string) (format:string) paramArray =
let inline invalidArgFmt (arg:string) (format:string) (paramArray: obj[]) =
let msg = String.Format (format, paramArray)
raise (ArgumentException(msg, arg))

/// takes an argument, a formatting string, a param array to splice into the formatting string
let inline invalidArgOutOfRangeFmt (arg:string) (format:string) paramArray =
let inline invalidArgOutOfRangeFmt (arg:string) (format:string) (paramArray: obj[]) =
let msg = String.Format (format, paramArray)
raise (ArgumentOutOfRangeException(arg, msg))

/// takes a formatting string and a param array to splice into the formatting string
let inline invalidOpFmt (format:string) paramArray =
let inline invalidOpFmt (format:string) (paramArray: obj[]) =
let msg = String.Format (format, paramArray)
raise (InvalidOperationException(msg))

Expand Down
9 changes: 6 additions & 3 deletions src/FSharp.Core/prim-types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,14 @@ namespace System.Diagnostics.CodeAnalysis
member this.DynamicallyAccessedMembersAttribute(memberTypes: DynamicallyAccessedMemberTypes) =
this.MemberTypes <- memberTypes

#endif

namespace Microsoft.FSharp.Core
open System
open System.Collections
open System.Collections.Generic
open System.Globalization
open System.Reflection
#endif

[<MeasureAnnotatedAbbreviation>] type float<[<Measure>] 'Measure> = float
[<MeasureAnnotatedAbbreviation>] type float32<[<Measure>] 'Measure> = float32
Expand Down Expand Up @@ -4096,6 +4097,7 @@ namespace Microsoft.FSharp.Core
and 'T voption = ValueOption<'T>

// These attributes only exist in .NET 8 and up.
#if !NET8_0_OR_GREATER
namespace System.Runtime.CompilerServices
open System
open Microsoft.FSharp.Core
Expand All @@ -4111,6 +4113,7 @@ namespace System.Runtime.CompilerServices
[<AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)>]
type internal ScopedRefAttribute () =
inherit Attribute ()
#endif

namespace Microsoft.FSharp.Collections

Expand All @@ -4128,7 +4131,7 @@ namespace Microsoft.FSharp.Collections
open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions
open Microsoft.FSharp.Core.BasicInlinedOperations

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET
[<System.Runtime.CompilerServices.CollectionBuilder(typeof<List>, "Create")>]
#endif
[<DefaultAugmentation(false)>]
Expand Down Expand Up @@ -4156,7 +4159,7 @@ namespace Microsoft.FSharp.Collections

and 'T list = List<'T>

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET
and [<CompilerMessage("This type is for compiler use and should not be used directly", 1204, IsHidden=true);
Sealed;
AbstractClass;
Expand Down
9 changes: 7 additions & 2 deletions src/FSharp.Core/prim-types.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,7 @@ namespace Microsoft.FSharp.Core.CompilerServices
[<CompilerMessage("This type is for compiler use and should not be used directly", 1204, IsHidden = true)>]
type SupportsWhenTEnum = class end

#if !NET5_0_OR_GREATER
namespace System.Diagnostics.CodeAnalysis

open System
Expand Down Expand Up @@ -1047,6 +1048,8 @@ namespace System.Diagnostics.CodeAnalysis
new: DynamicallyAccessedMemberTypes -> DynamicallyAccessedMembersAttribute
member MemberTypes: DynamicallyAccessedMemberTypes

#endif

namespace Microsoft.FSharp.Core

open System
Expand Down Expand Up @@ -2606,6 +2609,7 @@ namespace Microsoft.FSharp.Core
| Error of ErrorValue:'TError

// These attributes only exist in .NET 8 and up.
#if !NET8_0_OR_GREATER
namespace System.Runtime.CompilerServices
open System
open Microsoft.FSharp.Core
Expand Down Expand Up @@ -2637,6 +2641,7 @@ namespace System.Runtime.CompilerServices
type internal ScopedRefAttribute =
inherit Attribute
new: unit -> ScopedRefAttribute
#endif

namespace Microsoft.FSharp.Collections

Expand All @@ -2654,7 +2659,7 @@ namespace Microsoft.FSharp.Collections
/// </remarks>
///
/// <exclude />
#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET
[<System.Runtime.CompilerServices.CollectionBuilder(typeof<List>, "Create")>]
#endif
[<DefaultAugmentation(false)>]
Expand Down Expand Up @@ -2730,7 +2735,7 @@ namespace Microsoft.FSharp.Collections
/// </remarks>
and 'T list = List<'T>

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET
/// <summary>Contains methods for compiler use related to lists.</summary>
and [<CompilerMessage("This type is for compiler use and should not be used directly", 1204, IsHidden=true);
Sealed;
Expand Down
4 changes: 2 additions & 2 deletions src/FSharp.Core/set.fs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ module internal SetTree =
let ofArray comparer l =
Array.fold (fun acc k -> add comparer k acc) empty l

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET
[<System.Runtime.CompilerServices.CollectionBuilder(typeof<Set>, "Create")>]
#endif
[<Sealed>]
Expand Down Expand Up @@ -1097,7 +1097,7 @@ type Set<[<EqualityConditionalOn>] 'T when 'T: comparison>(comparer: IComparer<'
.Append("; ... ]")
.ToString()

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET
and [<CompilerMessage("This type is for compiler use and should not be used directly", 1204, IsHidden = true);
Sealed;
AbstractClass;
Expand Down
Loading
Loading