From ee3ef8f90f8cdf15912f477775b50968dacd559f Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 12 Aug 2025 16:24:48 +0200 Subject: [PATCH 01/10] Net9 to net10 --- DEVGUIDE.md | 6 ++-- Directory.Build.props | 2 +- UseLocalCompiler.Directory.Build.props | 6 ++-- .../FSharp.Compiler.Service_notshipped.fsproj | 2 +- .../FSharp.Core_notshipped.fsproj | 2 +- eng/Build.ps1 | 6 ++-- eng/build-utils.ps1 | 2 +- eng/build.sh | 2 +- eng/test-determinism.ps1 | 2 +- src/Compiler/Driver/FxResolver.fs | 2 +- tests/AheadOfTime/Equality/Equality.fsproj | 6 ++-- tests/AheadOfTime/Equality/check.ps1 | 6 ++-- ...SharpMetadataResource_Trimming_Test.fsproj | 4 +-- .../SelfContained_Trimming_Test.fsproj | 6 ++-- ...taticLinkedFSharpCore_Trimming_Test.fsproj | 6 ++-- tests/AheadOfTime/Trimming/check.ps1 | 12 +++---- .../BasicProvider.DesignTime.fsproj | 2 +- .../BasicProvider.Tests.fsproj | 2 +- .../BasicProvider/BasicProvider.fsproj | 2 +- .../BasicProvider/TestBasicProvider.cmd | 8 ++--- .../DependencyManagerInteractiveTests.fs | 36 +++++++++---------- .../FSharp.Compiler.Service.Tests.fsproj | 2 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 2 +- .../ProjectGeneration.fs | 2 +- tests/FSharp.Test.Utilities/TestFramework.fs | 2 +- tests/FSharp.Test.Utilities/Utilities.fs | 2 +- tests/ILVerify/ilverify.ps1 | 4 +-- .../BenchmarkComparison/runner.ipynb | 2 +- tests/fsharp/single-test.fs | 6 ++-- tests/fsharpqa/run.fsharpqa.test.fsx | 2 +- tests/scripts/identifierAnalysisByType.fsx | 2 +- 31 files changed, 74 insertions(+), 74 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index a8d24bcebc5..2d3e571b651 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -136,7 +136,7 @@ To use your custom build of `Fsc`, add the `DotnetFscCompilerPath` property to y ```xml - D:\Git\fsharp\artifacts\bin\fsc\Debug\net9.0\fsc.dll + D:\Git\fsharp\artifacts\bin\fsc\Debug\net10.0\fsc.dll ``` @@ -277,9 +277,9 @@ dotnet test tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fs These are IL baseline tests for the core assemblies of the compiler (FSharp.Core and FSharp.Compiler.Service). The baselines are located in the `tests/ILVerify` folder and look like: ``` -ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +ilverify_FSharp.Compiler.Service_Debug_net10.0.bsl ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl -ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +ilverify_FSharp.Compiler.Service_Release_net10.0.bsl ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl ilverify_FSharp.Core_Debug_netstandard2.0.bsl ilverify_FSharp.Core_Debug_netstandard2.1.bsl diff --git a/Directory.Build.props b/Directory.Build.props index 93391b5b776..6f7f345831e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,7 +6,7 @@ $(FSharpLangVersion) $(MSBuildThisFileDirectory) true - net9.0 + net10.0 $(DotNetBuildSourceOnly) false diff --git a/UseLocalCompiler.Directory.Build.props b/UseLocalCompiler.Directory.Build.props index 1b03ac191a8..35148efc0b5 100644 --- a/UseLocalCompiler.Directory.Build.props +++ b/UseLocalCompiler.Directory.Build.props @@ -11,15 +11,15 @@ $([System.IO.Path]::GetDirectoryName($(DOTNET_HOST_PATH))) $([System.IO.Path]::GetFileName($(DOTNET_HOST_PATH))) - $(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net9.0/fsc.dll - $(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net9.0/fsc.dll + $(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net10.0/fsc.dll + $(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net10.0/fsc.dll False True - $(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net9.0 + $(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net10.0 $(LocalFSharpBuildBinPath)/FSharp.Build.dll $(LocalFSharpBuildBinPath)/Microsoft.FSharp.Targets $(LocalFSharpBuildBinPath)/Microsoft.FSharp.NetSdk.props diff --git a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj index ab47e25013c..836a25096b2 100644 --- a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj +++ b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj @@ -3,7 +3,7 @@ - net9.0 + net10.0 true $(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid()) $(CachePath)\bin diff --git a/buildtools/checkpackages/FSharp.Core_notshipped.fsproj b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj index 7301910fba3..d032bd5839f 100644 --- a/buildtools/checkpackages/FSharp.Core_notshipped.fsproj +++ b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj @@ -3,7 +3,7 @@ - net9.0 + net10.0 diff --git a/eng/Build.ps1 b/eng/Build.ps1 index c9258234885..148b48f6650 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -35,8 +35,8 @@ param ( # Options [switch][Alias('proto')]$bootstrap, [string]$bootstrapConfiguration = "Proto", - [string]$bootstrapTfm = "net9.0", - [string]$fsharpNetCoreProductTfm = "net9.0", + [string]$bootstrapTfm = "net10.0", + [string]$fsharpNetCoreProductTfm = "net10.0", [switch][Alias('bl')]$binaryLog = $true, [switch][Alias('nobl')]$excludeCIBinaryLog = $false, [switch][Alias('nolog')]$noBinaryLog = $false, @@ -83,7 +83,7 @@ $BuildCategory = "" $BuildMessage = "" $desktopTargetFramework = "net472" -$coreclrTargetFramework = "net9.0" +$coreclrTargetFramework = "net10.0" function Print-Usage() { Write-Host "Common settings:" diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index 068f28bfc41..fdc274c66c2 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -14,7 +14,7 @@ $nodeReuse = if (Test-Path variable:nodeReuse) { $nodeReuse } else { $false } $bootstrapDir = if (Test-Path variable:bootstrapDir) { $bootstrapDir } else { "" } $bootstrapConfiguration = if (Test-Path variable:bootstrapConfiguration) { $bootstrapConfiguration } else { "Proto" } $bootstrapTfm = if (Test-Path variable:bootstrapTfm) { $bootstrapTfm } else { "net472" } -$fsharpNetCoreProductTfm = if (Test-Path variable:fsharpNetCoreProductTfm) { $fsharpNetCoreProductTfm } else { "net9.0" } +$fsharpNetCoreProductTfm = if (Test-Path variable:fsharpNetCoreProductTfm) { $fsharpNetCoreProductTfm } else { "net10.0" } $properties = if (Test-Path variable:properties) { $properties } else { @() } function GetProjectOutputBinary([string]$fileName, [string]$projectName = "", [string]$configuration = $script:configuration, [string]$tfm = "net472", [string]$rid = "", [bool]$published = $false) { diff --git a/eng/build.sh b/eng/build.sh index 54d96a056ba..2ad44838587 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -83,7 +83,7 @@ properties="" docker=false args="" -tfm="net9.0" # This needs to be changed every time it's bumped by arcade/us. +tfm="net10.0" # This needs to be changed every time it's bumped by arcade/us. BuildCategory="" BuildMessage="" diff --git a/eng/test-determinism.ps1 b/eng/test-determinism.ps1 index 8056de2b371..6e25e50fd4e 100644 --- a/eng/test-determinism.ps1 +++ b/eng/test-determinism.ps1 @@ -404,7 +404,7 @@ try { $script:bootstrap = $true $script:bootstrapConfiguration = "Proto" - $script:fsharpNetCoreProductTfm = "net9.0" + $script:fsharpNetCoreProductTfm = "net10.0" $script:bootstrapTfm = $script:fsharpNetCoreProductTfm $bootstrapDir = Make-BootstrapBuild diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index 5f55f6abe97..0b3a5a2517e 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -412,7 +412,7 @@ type internal FxResolver match runningTfmOpt with | Some tfm -> tfm - | _ -> if isRunningOnCoreClr then "net9.0" else "net472" + | _ -> if isRunningOnCoreClr then "net10.0" else "net472" let trySdkRefsPackDirectory = lazy diff --git a/tests/AheadOfTime/Equality/Equality.fsproj b/tests/AheadOfTime/Equality/Equality.fsproj index b4d38e1417b..0283d8bf0da 100644 --- a/tests/AheadOfTime/Equality/Equality.fsproj +++ b/tests/AheadOfTime/Equality/Equality.fsproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 preview true @@ -16,8 +16,8 @@ - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net9.0/fsc.dll - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net9.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net10.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net10.0/fsc.dll False True diff --git a/tests/AheadOfTime/Equality/check.ps1 b/tests/AheadOfTime/Equality/check.ps1 index b98083d2635..3aab08ef212 100644 --- a/tests/AheadOfTime/Equality/check.ps1 +++ b/tests/AheadOfTime/Equality/check.ps1 @@ -1,6 +1,6 @@ -Write-Host "Publish and Execute: net9.0 - Equality" +Write-Host "Publish and Execute: net10.0 - Equality" -$build_output = dotnet publish -restore -c release -f:net9.0 $(Join-Path $PSScriptRoot Equality.fsproj) +$build_output = dotnet publish -restore -c release -f:net10.0 $(Join-Path $PSScriptRoot Equality.fsproj) # Checking that the build succeeded if ($LASTEXITCODE -ne 0) @@ -10,7 +10,7 @@ if ($LASTEXITCODE -ne 0) } $process = Start-Process ` - -FilePath $(Join-Path $PSScriptRoot bin\release\net9.0\win-x64\publish\Equality.exe) ` + -FilePath $(Join-Path $PSScriptRoot bin\release\net10.0\win-x64\publish\Equality.exe) ` -Wait ` -NoNewWindow ` -PassThru ` diff --git a/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj index 5b56160b3d1..952812ab392 100644 --- a/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 preview true @@ -16,7 +16,7 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net9.0 + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net10.0 $(LocalFSharpBuildBinPath)/FSharp.Build.dll $(LocalFSharpBuildBinPath)/fsc.dll $(LocalFSharpBuildBinPath)/fsc.dll diff --git a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj index eb14a3b02dc..0d38e74b246 100644 --- a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 preview true @@ -16,8 +16,8 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net9.0/fsc.dll - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net9.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net10.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net10.0/fsc.dll False True diff --git a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj index 44505002299..1ff915b150a 100644 --- a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 preview true false @@ -18,8 +18,8 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net9.0/fsc.dll - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net9.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net10.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net10.0/fsc.dll False True diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1 index 0a28df7529b..6bf4366a71b 100644 --- a/tests/AheadOfTime/Trimming/check.ps1 +++ b/tests/AheadOfTime/Trimming/check.ps1 @@ -51,12 +51,12 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { # NOTE: Trimming now errors out on desktop TFMs, as shown below: # error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher. -# Check net9.0 trimmed assemblies -CheckTrim -root "SelfContained_Trimming_Test" -tfm "net9.0" -outputfile "FSharp.Core.dll" -expected_len 300032 +# Check net10.0 trimmed assemblies +CheckTrim -root "SelfContained_Trimming_Test" -tfm "net10.0" -outputfile "FSharp.Core.dll" -expected_len 300032 -# Check net9.0 trimmed assemblies with static linked FSharpCore -CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net9.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9154048 +# Check net10.0 trimmed assemblies with static linked FSharpCore +CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net10.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9154048 -# Check net9.0 trimmed assemblies with F# metadata resources removed -CheckTrim -root "FSharpMetadataResource_Trimming_Test" -tfm "net9.0" -outputfile "FSharpMetadataResource_Trimming_Test.dll" -expected_len 7601152 +# Check net10.0 trimmed assemblies with F# metadata resources removed +CheckTrim -root "FSharpMetadataResource_Trimming_Test" -tfm "net10.0" -outputfile "FSharpMetadataResource_Trimming_Test.dll" -expected_len 7601152 diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj index 207ac178db9..72d675b1329 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj @@ -2,7 +2,7 @@ Library - net9.0;net472 + net10.0;net472 typeproviders NO_GENERATIVE IS_DESIGNTIME diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj index 4bc1b805799..f9d5b424c3a 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj @@ -2,7 +2,7 @@ Library - net9.0 + net10.0 $(TestTargetFramework) false NO_GENERATIVE diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj index 24c2188c543..01979192d6a 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj @@ -2,7 +2,7 @@ Library - net9.0;net472 + net10.0;net472 typeproviders $(FSharpCoreShippedPackageVersionValue) typeproviders diff --git a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd index 38e87f02572..c7ba6b18336 100644 --- a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd +++ b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd @@ -42,8 +42,8 @@ echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuratio dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net9.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net9.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net10.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net10.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure rem @@ -60,8 +60,8 @@ echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuratio dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net9.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net9.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net10.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net10.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure :success diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 3e6b7b27e43..819fe92ec2c 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -89,7 +89,7 @@ type DependencyManagerInteractiveTests() = Assert.Equal(1, result.SourceFiles |> Seq.length) Assert.Equal(2, result.Roots |> Seq.length) - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net9.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net10.0") Assert.Equal(true, result.Success) Assert.Equal(1, result.Resolutions |> Seq.length) Assert.Equal(1, result.SourceFiles |> Seq.length) @@ -111,7 +111,7 @@ type DependencyManagerInteractiveTests() = let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite, 3.1.8"|], reportError, "net9.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite, 3.1.8"|], reportError, "net10.0") Assert.Equal(true, result.Success) Assert.True((result.Resolutions |> Seq.length) > 1) Assert.Equal(1, result.SourceFiles |> Seq.length) @@ -141,7 +141,7 @@ type DependencyManagerInteractiveTests() = Assert.Equal(0, result.SourceFiles |> Seq.length) Assert.Equal(0, result.Roots |> Seq.length) - let result = dp.Resolve(idm, ".fsx", [|"r", "System.Collections.Immutable.DoesNotExist"|], reportError, "net9.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "System.Collections.Immutable.DoesNotExist"|], reportError, "net10.0") Assert.Equal(false, result.Success) Assert.Equal(0, result.Resolutions |> Seq.length) Assert.Equal(0, result.SourceFiles |> Seq.length) @@ -171,7 +171,7 @@ type DependencyManagerInteractiveTests() = Assert.True((result1.Roots |> Seq.head).EndsWith("/fsharp.data/3.3.3/")) Assert.True((result1.Roots |> Seq.last).EndsWith("/microsoft.netframework.referenceassemblies/1.0.0/")) - let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net9.0") + let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net10.0") Assert.Equal(true, result2.Success) Assert.Equal(1, result2.Resolutions |> Seq.length) let expected2 = "/netstandard2.0/" @@ -192,7 +192,7 @@ type DependencyManagerInteractiveTests() = Assert.Equal(1, result3.SourceFiles |> Seq.length) Assert.True((result3.Roots |> Seq.head).EndsWith("/system.json/4.6.0/")) - let result4 = dp2.Resolve(idm2, ".fsx", [|"r", "System.Json, Version=4.6.0"|], reportError, "net9.0") + let result4 = dp2.Resolve(idm2, ".fsx", [|"r", "System.Json, Version=4.6.0"|], reportError, "net10.0") Assert.Equal(true, result4.Success) Assert.Equal(1, result4.Resolutions |> Seq.length) let expected4 = "/netstandard2.0/" @@ -228,7 +228,7 @@ type DependencyManagerInteractiveTests() = // Netstandard gets fewer dependencies than desktop, because desktop framework doesn't contain assemblies like System.Memory // Those assemblies must be delivered by nuget for desktop apps - let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "Microsoft.Extensions.Configuration.Abstractions, 3.1.1"|], reportError, "net9.0") + let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "Microsoft.Extensions.Configuration.Abstractions, 3.1.1"|], reportError, "net10.0") Assert.Equal(true, result2.Success) Assert.Equal(2, result2.Resolutions |> Seq.length) let expected = "/netcoreapp3.1/" @@ -288,7 +288,7 @@ TorchSharp.Tensor.LongTensor.From([| 0L .. 100L |]).Device let result = use dp = new DependencyProvider(AssemblyResolutionProbe(assemblyProbingPaths), NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net9.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net10.0") Assert.True(result.Success, "resolve failed") @@ -386,7 +386,7 @@ printfn ""%A"" result let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net9.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net10.0") Assert.True(result.Success, "resolve failed") @@ -471,7 +471,7 @@ printfn ""%A"" result let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net9.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net10.0") Assert.True(result.Success, "resolve failed") @@ -525,7 +525,7 @@ x |> Seq.iter(fun r -> let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net9.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net10.0") // Expected: error FS3217: PackageManager cannot reference the System Package 'FSharp.Core' Assert.False(result.Success, "resolve succeeded but should have failed") @@ -548,7 +548,7 @@ x |> Seq.iter(fun r -> let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".csx", packagemanagerlines, reportError, "net9.0") + dp.Resolve(idm, ".csx", packagemanagerlines, reportError, "net10.0") Assert.True(result.Success, "resolve failed but should have succeeded") @@ -591,7 +591,7 @@ x |> Seq.iter(fun r -> Assert.Equal(1, result.SourceFiles |> Seq.length) Assert.Equal(2, result.Roots |> Seq.length) - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net9.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net10.0") Assert.Equal(true, result.Success) Assert.Equal(1, result.Resolutions |> Seq.length) Assert.Equal(1, result.SourceFiles |> Seq.length) @@ -698,7 +698,7 @@ x |> Seq.iter(fun r -> let mutable currentPath:string = null use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite,3.1.7"|], reportError, "net9.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite,3.1.7"|], reportError, "net10.0") Assert.Equal(true, result.Success) currentPath <- appendSemiColon (Environment.GetEnvironmentVariable("PATH")) finalPath <- appendSemiColon (Environment.GetEnvironmentVariable("PATH")) @@ -786,7 +786,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net9.0", timeout=0) // Fail in 0 milliseconds + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net10.0", timeout=0) // Fail in 0 milliseconds Assert.Equal(false, result.Success) Assert.Equal(foundCorrectError, true) Assert.Equal(foundWrongError, false) @@ -809,7 +809,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net9.0", null, "", "", "", -1) // Wait forever + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net10.0", null, "", "", "", -1) // Wait forever Assert.Equal(false, result.Success) Assert.Equal(foundCorrectError, true) Assert.Equal(foundWrongError, false) @@ -832,7 +832,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=none"|], reportError, "net9.0", null, "", "", "", -1) // Wait forever + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=none"|], reportError, "net10.0", null, "", "", "", -1) // Wait forever Assert.Equal(true, result.Success) Assert.Equal(foundCorrectError, false) Assert.Equal(foundWrongError, false) @@ -858,7 +858,7 @@ x |> Seq.iter(fun r -> let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") // Resolve and cache the results won't time out - let _result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=10000"|], reportError, "net9.0", null, "", "", "", -1) // Wait forever + let _result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=10000"|], reportError, "net10.0", null, "", "", "", -1) // Wait forever // Clear the results foundCorrectError <- false @@ -867,7 +867,7 @@ x |> Seq.iter(fun r -> // Now clear the cache --- this will ensure that resolving produces a timeout error. If we read from the cache the test will fail dp.ClearResultsCache(Seq.empty, "", reportError) - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net9.0", null, "", "", "", -1) // Wait forever + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net10.0", null, "", "", "", -1) // Wait forever Assert.Equal(false, result.Success) Assert.Equal(foundCorrectError, true) Assert.Equal(foundWrongError, false) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 4f5cdab60f5..c85db73b631 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -90,7 +90,7 @@ - + TargetFramework=netstandard2.0 diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 6e53a2a3f89..d7c910e05f9 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -616,7 +616,7 @@ module CompilerAssertHelpers = let runtimeconfig = """ { "runtimeOptions": { - "tfm": "net9.0", + "tfm": "net10.0", "framework": { "name": "Microsoft.NETCore.App", "version": "7.0" diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs index fe10fb4f0fc..6c9684557a5 100644 --- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs +++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs @@ -448,7 +448,7 @@ let private renderFsProj (p: SyntheticProject) = Exe - net9.0 + net10.0 diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 768203aa887..fd144be0f69 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -300,7 +300,7 @@ let config configurationName envVars = let fsharpCoreArchitecture = "netstandard2.0" let fsharpBuildArchitecture = "netstandard2.0" let fsharpCompilerInteractiveSettingsArchitecture = "netstandard2.0" - let dotnetArchitecture = "net9.0" + let dotnetArchitecture = "net10.0" #if NET472 let fscArchitecture = "net472" let fsiArchitecture = "net472" diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index 06667fadfaf..ab7116d64d4 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -208,7 +208,7 @@ let main argv = 0""" let directoryBuildTargetsFileName = Path.Combine(projectDirectory, "Directory.Build.targets") let frameworkReferencesFileName = Path.Combine(projectDirectory, "FrameworkReferences.txt") #if NETCOREAPP - File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net9.0").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) + File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net10.0").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) #else File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net472").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) #endif diff --git a/tests/ILVerify/ilverify.ps1 b/tests/ILVerify/ilverify.ps1 index 75cc421009e..8969747c0ac 100644 --- a/tests/ILVerify/ilverify.ps1 +++ b/tests/ILVerify/ilverify.ps1 @@ -24,7 +24,7 @@ Write-Host "Repository path: $repo_path" # List projects to verify, with TFMs $projects = @{ "FSharp.Core" = @($default_tfm, "netstandard2.1") - "FSharp.Compiler.Service" = @($default_tfm, "net9.0") + "FSharp.Compiler.Service" = @($default_tfm, "net10.0") } # Check ilverify can run @@ -111,7 +111,7 @@ foreach ($project in $projects.Keys) { $ilverify_output = @(Invoke-Expression "& $ilverify_cmd" -ErrorAction SilentlyContinue) # Normalize output, get rid of paths in log like - # [IL]: Error [StackUnexpected]: [/Users/u/code/fsharp3/artifacts/bin/FSharp.Compiler.Service/Release/net9.0/FSharp.Core.dll : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. + # [IL]: Error [StackUnexpected]: [/Users/u/code/fsharp3/artifacts/bin/FSharp.Compiler.Service/Release/net10.0/FSharp.Core.dll : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. # This is a quick and dirty way to do it, but it works for now. $ilverify_output = $ilverify_output | ForEach-Object { if ($_ -match "\[IL\]: Error \[") { diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb index b862fdaf4e5..bc36ab00cf7 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb @@ -18,7 +18,7 @@ "#r \"nuget: Plotly.NET.Interactive, 3.0.0\"\n", "#r \"nuget: LibGit2Sharp, 0.26.2\"\n", "#r \"nuget: BenchmarkDotnet, 0.13.1\"\n", - "#r \"../../../../artifacts/bin/HistoricalBenchmark.Runner/Release/net9.0/HistoricalBenchmark.Runner.dll\"\n", + "#r \"../../../../artifacts/bin/HistoricalBenchmark.Runner/Release/net10.0/HistoricalBenchmark.Runner.dll\"\n", "\n", "open HistoricalBenchmark.Runner\n", "\n", diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index af220c091b4..5f33b3b1b6b 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -220,7 +220,7 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion = let extraSources = ["testlib.fsi";"testlib.fs";"test.mli";"test.ml";"test.fsi";"test.fs";"test2.fsi";"test2.fs";"test.fsx";"test2.fsx"] let utilitySources = [] let referenceItems = if String.IsNullOrEmpty(copyFiles) then [] else [copyFiles] - let framework = "net9.0" + let framework = "net10.0" // Arguments: // outputType = OutputType.Exe, OutputType.Library or OutputType.Script @@ -284,8 +284,8 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion = match p with #if NETCOREAPP - | FSC_NETCORE (optimized, buildOnly) -> executeSingleTestBuildAndRun OutputType.Exe "coreclr" "net9.0" optimized buildOnly - | FSI_NETCORE -> executeSingleTestBuildAndRun OutputType.Script "coreclr" "net9.0" true false + | FSC_NETCORE (optimized, buildOnly) -> executeSingleTestBuildAndRun OutputType.Exe "coreclr" "net10.0" optimized buildOnly + | FSI_NETCORE -> executeSingleTestBuildAndRun OutputType.Script "coreclr" "net10.0" true false #else | FSC_NETFX (optimized, buildOnly) -> executeSingleTestBuildAndRun OutputType.Exe "net40" "net472" optimized buildOnly | FSI_NETFX -> executeSingleTestBuildAndRun OutputType.Script "net40" "net472" true false diff --git a/tests/fsharpqa/run.fsharpqa.test.fsx b/tests/fsharpqa/run.fsharpqa.test.fsx index b3e277e7f3a..b50736b40cb 100644 --- a/tests/fsharpqa/run.fsharpqa.test.fsx +++ b/tests/fsharpqa/run.fsharpqa.test.fsx @@ -22,7 +22,7 @@ let nugetCache = | null -> Path.Combine(System.Environment.GetEnvironmentVariable "USERPROFILE", ".nuget", "packages") | path -> path let rootFolder = Path.Combine(__SOURCE_DIRECTORY__, "..", "..") -let compilerBinFolder = Path.Combine(rootFolder, "artifacts", "bin", "fsc", releaseOrDebug, "net9.0") +let compilerBinFolder = Path.Combine(rootFolder, "artifacts", "bin", "fsc", releaseOrDebug, "net10.0") setEnvVar "CSC_PIPE" (Path.Combine(nugetCache, "Microsoft.Net.Compilers", "4.3.0-1.22220.8", "tools", "csc.exe")) setEnvVar "FSC" (Path.Combine(compilerBinFolder, "fsc.exe")) setEnvVar "FSCOREDLLPATH" (Path.Combine(compilerBinFolder, "FSharp.Core.dll")) diff --git a/tests/scripts/identifierAnalysisByType.fsx b/tests/scripts/identifierAnalysisByType.fsx index 72ff876d2f0..2e92c952159 100644 --- a/tests/scripts/identifierAnalysisByType.fsx +++ b/tests/scripts/identifierAnalysisByType.fsx @@ -2,7 +2,7 @@ // #r "nuget: Ionide.ProjInfo" -#I @"..\..\artifacts\bin\fsc\Debug\net9.0\" +#I @"..\..\artifacts\bin\fsc\Debug\net10.0\" #r "FSharp.Compiler.Service.dll" open System From 3421591b4dec7de9724333f8b7f82f3c033e246c Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Aug 2025 12:10:34 +0200 Subject: [PATCH 02/10] Update Directory.Build.props --- tests/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 80708062652..c2f0cf4bed4 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -8,7 +8,7 @@ - + From d439affb1962a52e45da0909b24142c550ce63b5 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Aug 2025 12:14:53 +0200 Subject: [PATCH 03/10] rename ilverify bsl --- ...9.0.bsl => ilverify_FSharp.Compiler.Service_Debug_net10.0.bsl} | 0 ...0.bsl => ilverify_FSharp.Compiler.Service_Release_net10.0.bsl} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/ILVerify/{ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl => ilverify_FSharp.Compiler.Service_Debug_net10.0.bsl} (100%) rename tests/ILVerify/{ilverify_FSharp.Compiler.Service_Release_net9.0.bsl => ilverify_FSharp.Compiler.Service_Release_net10.0.bsl} (100%) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net10.0.bsl similarity index 100% rename from tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl rename to tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net10.0.bsl diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net10.0.bsl similarity index 100% rename from tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl rename to tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net10.0.bsl From 5ff490e2efe673bbc63740d4eed24c1f5af7b144 Mon Sep 17 00:00:00 2001 From: GH Actions Date: Wed, 13 Aug 2025 10:21:54 +0000 Subject: [PATCH 04/10] Apply patch from /run test-baseline --- .../Nullness/ReferenceDU.fs.il.netcore.bsl | 41 ++++++------ .../StaticOptimizations/String_Enum.fs.il.bsl | 65 ++++++++++--------- .../String_SignedIntegralTypes.fs.il.bsl | 61 ++++++++++------- ...sx.realInternalSignatureOff.il.netcore.bsl | 27 ++++---- ...fsx.realInternalSignatureOn.il.netcore.bsl | 27 ++++---- 5 files changed, 114 insertions(+), 107 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl index 423360aff64..6ec8e1b1207 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl @@ -662,9 +662,8 @@ class MyTestModule/MyDu/JustInt V_2, int32 V_3, int32 V_4, - int32 V_5, - class MyTestModule/MyDu/MaybeString V_6, - string V_7) + class MyTestModule/MyDu/MaybeString V_5, + string V_6) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloc.0 @@ -678,7 +677,7 @@ IL_000f: ldloc.1 IL_0010: isinst MyTestModule/MyDu/MaybeString - IL_0015: brtrue.s IL_0040 + IL_0015: brtrue.s IL_0048 IL_0017: br.s IL_001b @@ -697,22 +696,23 @@ IL_002b: ldloc.3 IL_002c: stloc.s V_4 IL_002e: ldloc.s V_4 - IL_0030: stloc.s V_5 - IL_0032: ldloca.s V_5 - IL_0034: ldnull - IL_0035: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_003a: call instance string [netstandard]System.Int32::ToString(string, - class [netstandard]System.IFormatProvider) - IL_003f: ret - - IL_0040: ldloc.0 - IL_0041: castclass MyTestModule/MyDu/MaybeString - IL_0046: stloc.s V_6 - IL_0048: ldloc.s V_6 - IL_004a: ldfld string MyTestModule/MyDu/MaybeString::_nullableString - IL_004f: stloc.s V_7 - IL_0051: ldloc.s V_7 - IL_0053: ret + IL_0030: box [runtime]System.Int32 + IL_0035: unbox.any [runtime]System.IFormattable + IL_003a: ldnull + IL_003b: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0040: tail. + IL_0042: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0047: ret + + IL_0048: ldloc.0 + IL_0049: castclass MyTestModule/MyDu/MaybeString + IL_004e: stloc.s V_5 + IL_0050: ldloc.s V_5 + IL_0052: ldfld string MyTestModule/MyDu/MaybeString::_nullableString + IL_0057: stloc.s V_6 + IL_0059: ldloc.s V_6 + IL_005b: ret } } @@ -726,4 +726,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl index 740505ce6a7..d1b1f629268 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl @@ -130,53 +130,61 @@ .method public static string 'string'(valuetype assembly/String/SByteEnum 'enum') cil managed { - .maxstack 3 - .locals init (valuetype assembly/String/SByteEnum V_0) + .maxstack 8 IL_0000: ldarg.0 - IL_0001: stloc.0 - IL_0002: ldloca.s V_0 - IL_0004: constrained. assembly/String/SByteEnum - IL_000a: callvirt instance string [netstandard]System.Object::ToString() - IL_000f: ret + IL_0001: box assembly/String/SByteEnum + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } .method public static string 'string'(valuetype assembly/String/Int16Enum 'enum') cil managed { - .maxstack 3 - .locals init (valuetype assembly/String/Int16Enum V_0) + .maxstack 8 IL_0000: ldarg.0 - IL_0001: stloc.0 - IL_0002: ldloca.s V_0 - IL_0004: constrained. assembly/String/Int16Enum - IL_000a: callvirt instance string [netstandard]System.Object::ToString() - IL_000f: ret + IL_0001: box assembly/String/Int16Enum + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } .method public static string 'string'(valuetype assembly/String/Int32Enum 'enum') cil managed { - .maxstack 3 - .locals init (valuetype assembly/String/Int32Enum V_0) + .maxstack 8 IL_0000: ldarg.0 - IL_0001: stloc.0 - IL_0002: ldloca.s V_0 - IL_0004: constrained. assembly/String/Int32Enum - IL_000a: callvirt instance string [netstandard]System.Object::ToString() - IL_000f: ret + IL_0001: box assembly/String/Int32Enum + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } .method public static string 'string'(valuetype assembly/String/Int64Enum 'enum') cil managed { - .maxstack 3 - .locals init (valuetype assembly/String/Int64Enum V_0) + .maxstack 8 IL_0000: ldarg.0 - IL_0001: stloc.0 - IL_0002: ldloca.s V_0 - IL_0004: constrained. assembly/String/Int64Enum - IL_000a: callvirt instance string [netstandard]System.Object::ToString() - IL_000f: ret + IL_0001: box assembly/String/Int64Enum + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } .method public static string 'string'(valuetype assembly/String/ByteEnum 'enum') cil managed @@ -540,4 +548,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl index c1470054a4d..6adb1a05e21 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl @@ -46,48 +46,60 @@ { .maxstack 8 - IL_0000: ldarga.s 'value' - IL_0002: ldnull - IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0008: call instance string [netstandard]System.SByte::ToString(string, - class [netstandard]System.IFormatProvider) - IL_000d: ret + IL_0000: ldarg.0 + IL_0001: box [runtime]System.SByte + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } .method public static string 'string int16'(int16 'value') cil managed { .maxstack 8 - IL_0000: ldarga.s 'value' - IL_0002: ldnull - IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0008: call instance string [netstandard]System.Int16::ToString(string, - class [netstandard]System.IFormatProvider) - IL_000d: ret + IL_0000: ldarg.0 + IL_0001: box [runtime]System.Int16 + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } .method public static string 'string int32'(int32 'value') cil managed { .maxstack 8 - IL_0000: ldarga.s 'value' - IL_0002: ldnull - IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0008: call instance string [netstandard]System.Int32::ToString(string, - class [netstandard]System.IFormatProvider) - IL_000d: ret + IL_0000: ldarg.0 + IL_0001: box [runtime]System.Int32 + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } .method public static string 'string int64'(int64 'value') cil managed { .maxstack 8 - IL_0000: ldarga.s 'value' - IL_0002: ldnull - IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0008: call instance string [netstandard]System.Int64::ToString(string, - class [netstandard]System.IFormatProvider) - IL_000d: ret + IL_0000: ldarg.0 + IL_0001: box [runtime]System.Int64 + IL_0006: unbox.any [runtime]System.IFormattable + IL_000b: ldnull + IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0011: tail. + IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0018: ret } } @@ -111,4 +123,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOff.il.netcore.bsl index 738dbe91401..4391a91faed 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOff.il.netcore.bsl @@ -5,15 +5,10 @@ .assembly extern runtime { } .assembly extern FSharp.Core { } -.assembly extern System.Collections -{ - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) - .ver 9:0:0:0 -} .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) - .ver 9:0:0:0 + .ver 10:0:0:0 } .assembly assembly { @@ -53,26 +48,26 @@ } - .method public specialname static class [System.Collections]System.Collections.Generic.List`1 get_r() cil managed + .method public specialname static class [runtime]System.Collections.Generic.List`1 get_r() cil managed { .maxstack 8 - IL_0000: ldsfld class [System.Collections]System.Collections.Generic.List`1 ''.$assembly$fsx::r@2 + IL_0000: ldsfld class [runtime]System.Collections.Generic.List`1 ''.$assembly$fsx::r@2 IL_0005: ret } - .property class [System.Collections]System.Collections.Generic.List`1 + .property class [runtime]System.Collections.Generic.List`1 r() { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [System.Collections]System.Collections.Generic.List`1 assembly::get_r() + .get class [runtime]System.Collections.Generic.List`1 assembly::get_r() } } .class private abstract auto ansi sealed ''.$assembly$fsx extends [runtime]System.Object { - .field static assembly initonly class [System.Collections]System.Collections.Generic.List`1 r@2 + .field static assembly initonly class [runtime]System.Collections.Generic.List`1 r@2 .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field static assembly int32 init@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) @@ -82,12 +77,12 @@ { .maxstack 8 - IL_0000: newobj instance void class [System.Collections]System.Collections.Generic.List`1::.ctor() - IL_0005: stsfld class [System.Collections]System.Collections.Generic.List`1 ''.$assembly$fsx::r@2 - IL_000a: call class [System.Collections]System.Collections.Generic.List`1 assembly::get_r() - IL_000f: callvirt instance int32 class [System.Collections]System.Collections.Generic.List`1::get_Count() + IL_0000: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_0005: stsfld class [runtime]System.Collections.Generic.List`1 ''.$assembly$fsx::r@2 + IL_000a: call class [runtime]System.Collections.Generic.List`1 assembly::get_r() + IL_000f: callvirt instance int32 class [runtime]System.Collections.Generic.List`1::get_Count() IL_0014: pop - IL_0015: call class [System.Collections]System.Collections.Generic.List`1 assembly::get_r() + IL_0015: call class [runtime]System.Collections.Generic.List`1 assembly::get_r() IL_001a: ldnull IL_001b: ldftn bool assembly/clo@4::Invoke(int32) IL_0021: newobj instance void class [runtime]System.Func`2::.ctor(object, diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOn.il.netcore.bsl index 43a507d345d..0a13b363bd2 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Shadowing/LinqCount.fsx.realInternalSignatureOn.il.netcore.bsl @@ -5,15 +5,10 @@ .assembly extern runtime { } .assembly extern FSharp.Core { } -.assembly extern System.Collections -{ - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) - .ver 9:0:0:0 -} .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) - .ver 9:0:0:0 + .ver 10:0:0:0 } .assembly assembly { @@ -53,13 +48,13 @@ } - .field static assembly class [System.Collections]System.Collections.Generic.List`1 r@2 + .field static assembly class [runtime]System.Collections.Generic.List`1 r@2 .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public specialname static class [System.Collections]System.Collections.Generic.List`1 get_r() cil managed + .method public specialname static class [runtime]System.Collections.Generic.List`1 get_r() cil managed { .maxstack 8 - IL_0000: ldsfld class [System.Collections]System.Collections.Generic.List`1 assembly::r@2 + IL_0000: ldsfld class [runtime]System.Collections.Generic.List`1 assembly::r@2 IL_0005: ret } @@ -78,12 +73,12 @@ { .maxstack 8 - IL_0000: newobj instance void class [System.Collections]System.Collections.Generic.List`1::.ctor() - IL_0005: stsfld class [System.Collections]System.Collections.Generic.List`1 assembly::r@2 - IL_000a: call class [System.Collections]System.Collections.Generic.List`1 assembly::get_r() - IL_000f: callvirt instance int32 class [System.Collections]System.Collections.Generic.List`1::get_Count() + IL_0000: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_0005: stsfld class [runtime]System.Collections.Generic.List`1 assembly::r@2 + IL_000a: call class [runtime]System.Collections.Generic.List`1 assembly::get_r() + IL_000f: callvirt instance int32 class [runtime]System.Collections.Generic.List`1::get_Count() IL_0014: pop - IL_0015: call class [System.Collections]System.Collections.Generic.List`1 assembly::get_r() + IL_0015: call class [runtime]System.Collections.Generic.List`1 assembly::get_r() IL_001a: ldnull IL_001b: ldftn bool assembly/clo@4::Invoke(int32) IL_0021: newobj instance void class [runtime]System.Func`2::.ctor(object, @@ -94,11 +89,11 @@ IL_002c: ret } - .property class [System.Collections]System.Collections.Generic.List`1 + .property class [runtime]System.Collections.Generic.List`1 r() { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [System.Collections]System.Collections.Generic.List`1 assembly::get_r() + .get class [runtime]System.Collections.Generic.List`1 assembly::get_r() } } From 9f57cfa4d80777014b7544f443d7c20c2808cab5 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Aug 2025 13:37:19 +0200 Subject: [PATCH 05/10] Revert wrong ilbaseline adjustion --- .../Nullness/ReferenceDU.fs.il.netcore.bsl | 41 ++++++------ .../StaticOptimizations/String_Enum.fs.il.bsl | 65 +++++++++---------- .../String_SignedIntegralTypes.fs.il.bsl | 61 +++++++---------- 3 files changed, 75 insertions(+), 92 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl index 6ec8e1b1207..423360aff64 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl @@ -662,8 +662,9 @@ class MyTestModule/MyDu/JustInt V_2, int32 V_3, int32 V_4, - class MyTestModule/MyDu/MaybeString V_5, - string V_6) + int32 V_5, + class MyTestModule/MyDu/MaybeString V_6, + string V_7) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloc.0 @@ -677,7 +678,7 @@ IL_000f: ldloc.1 IL_0010: isinst MyTestModule/MyDu/MaybeString - IL_0015: brtrue.s IL_0048 + IL_0015: brtrue.s IL_0040 IL_0017: br.s IL_001b @@ -696,23 +697,22 @@ IL_002b: ldloc.3 IL_002c: stloc.s V_4 IL_002e: ldloc.s V_4 - IL_0030: box [runtime]System.Int32 - IL_0035: unbox.any [runtime]System.IFormattable - IL_003a: ldnull - IL_003b: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0040: tail. - IL_0042: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0047: ret - - IL_0048: ldloc.0 - IL_0049: castclass MyTestModule/MyDu/MaybeString - IL_004e: stloc.s V_5 - IL_0050: ldloc.s V_5 - IL_0052: ldfld string MyTestModule/MyDu/MaybeString::_nullableString - IL_0057: stloc.s V_6 - IL_0059: ldloc.s V_6 - IL_005b: ret + IL_0030: stloc.s V_5 + IL_0032: ldloca.s V_5 + IL_0034: ldnull + IL_0035: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_003a: call instance string [netstandard]System.Int32::ToString(string, + class [netstandard]System.IFormatProvider) + IL_003f: ret + + IL_0040: ldloc.0 + IL_0041: castclass MyTestModule/MyDu/MaybeString + IL_0046: stloc.s V_6 + IL_0048: ldloc.s V_6 + IL_004a: ldfld string MyTestModule/MyDu/MaybeString::_nullableString + IL_004f: stloc.s V_7 + IL_0051: ldloc.s V_7 + IL_0053: ret } } @@ -726,3 +726,4 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl index d1b1f629268..740505ce6a7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl @@ -130,61 +130,53 @@ .method public static string 'string'(valuetype assembly/String/SByteEnum 'enum') cil managed { - .maxstack 8 + .maxstack 3 + .locals init (valuetype assembly/String/SByteEnum V_0) IL_0000: ldarg.0 - IL_0001: box assembly/String/SByteEnum - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/SByteEnum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret } .method public static string 'string'(valuetype assembly/String/Int16Enum 'enum') cil managed { - .maxstack 8 + .maxstack 3 + .locals init (valuetype assembly/String/Int16Enum V_0) IL_0000: ldarg.0 - IL_0001: box assembly/String/Int16Enum - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/Int16Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret } .method public static string 'string'(valuetype assembly/String/Int32Enum 'enum') cil managed { - .maxstack 8 + .maxstack 3 + .locals init (valuetype assembly/String/Int32Enum V_0) IL_0000: ldarg.0 - IL_0001: box assembly/String/Int32Enum - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/Int32Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret } .method public static string 'string'(valuetype assembly/String/Int64Enum 'enum') cil managed { - .maxstack 8 + .maxstack 3 + .locals init (valuetype assembly/String/Int64Enum V_0) IL_0000: ldarg.0 - IL_0001: box assembly/String/Int64Enum - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/Int64Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret } .method public static string 'string'(valuetype assembly/String/ByteEnum 'enum') cil managed @@ -548,3 +540,4 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl index 6adb1a05e21..c1470054a4d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl @@ -46,60 +46,48 @@ { .maxstack 8 - IL_0000: ldarg.0 - IL_0001: box [runtime]System.SByte - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.SByte::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret } .method public static string 'string int16'(int16 'value') cil managed { .maxstack 8 - IL_0000: ldarg.0 - IL_0001: box [runtime]System.Int16 - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.Int16::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret } .method public static string 'string int32'(int32 'value') cil managed { .maxstack 8 - IL_0000: ldarg.0 - IL_0001: box [runtime]System.Int32 - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.Int32::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret } .method public static string 'string int64'(int64 'value') cil managed { .maxstack 8 - IL_0000: ldarg.0 - IL_0001: box [runtime]System.Int64 - IL_0006: unbox.any [runtime]System.IFormattable - IL_000b: ldnull - IL_000c: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0011: tail. - IL_0013: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0018: ret + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.Int64::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret } } @@ -123,3 +111,4 @@ + From afdb51ad330400dbc736486adc08c3daef4053fb Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Aug 2025 17:31:58 +0200 Subject: [PATCH 06/10] Update SpanOptimizationTests.fs --- .../Language/SpanOptimizationTests.fs | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs index d2161a85d72..25f260cf94a 100644 --- a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs +++ b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs @@ -159,27 +159,7 @@ module Test = (fun verifier -> verifier.VerifyIL [ """ - .method public static void test() cil managed - { - - .maxstack 3 - .locals init (valuetype System.Span`1 V_0, - valuetype [runtime]System.Span`1/Enumerator V_1, - valuetype [runtime]System.Span`1 V_2, - object& V_3) - IL_0000: call !!0[] [runtime]System.Array::Empty() - IL_0005: newobj instance void valuetype System.Span`1::.ctor(!0[]) - IL_000a: stloc.0 - IL_000b: ldloca.s V_0 - IL_000d: ldfld !0[] valuetype System.Span`1::arr - IL_0012: call valuetype [runtime]System.Span`1 [runtime]System.MemoryExtensions::AsSpan(!!0[]) - IL_0017: stloc.2 - IL_0018: ldloca.s V_2 - IL_001a: call instance valuetype [runtime]System.Span`1/Enumerator valuetype [runtime]System.Span`1::GetEnumerator() - IL_001f: stloc.1 - .try - { - IL_0020: br.s IL_0035 + IL_0022: ldloca.s V_1 IL_0024: call instance !0& valuetype [runtime]System.Span`1/Enumerator::get_Current() From afc09cdbaf50c2df34557e8ec4197c7f1fd2d281 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Aug 2025 17:35:17 +0200 Subject: [PATCH 07/10] Update SpanOptimizationTests.fs --- .../Language/SpanOptimizationTests.fs | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs index 25f260cf94a..877e1b7b337 100644 --- a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs +++ b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs @@ -159,27 +159,31 @@ module Test = (fun verifier -> verifier.VerifyIL [ """ +.method public static void test() cil managed + { + + .maxstack 3 + .locals init (valuetype System.Span`1 V_0, + valuetype [runtime]System.Span`1/Enumerator V_1, + valuetype [runtime]System.Span`1 V_2, + object& V_3) + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: newobj instance void valuetype System.Span`1::.ctor(!0[]) + IL_000a: stloc.0 + IL_000b: ldloca.s V_0 + IL_000d: ldfld !0[] valuetype System.Span`1::arr + IL_0012: call valuetype [runtime]System.Span`1 [runtime]System.MemoryExtensions::AsSpan(!!0[]) + IL_0017: stloc.2 + IL_0018: ldloca.s V_2 + IL_001a: call instance valuetype [runtime]System.Span`1/Enumerator valuetype [runtime]System.Span`1::GetEnumerator() + IL_001f: stloc.1 + .try + { + IL_0020: br.s IL_0035 + + IL_0022: ldloca.s V_1 + IL_0024: call instance !0& valuetype [runtime]System.Span`1/Enumerator::get_Current() - - IL_0022: ldloca.s V_1 - IL_0024: call instance !0& valuetype [runtime]System.Span`1/Enumerator::get_Current() - IL_0029: stloc.3 - IL_002a: ldloc.3 - IL_002b: ldobj [runtime]System.Object - IL_0030: call void [runtime]System.Console::WriteLine(object) - IL_0035: ldloca.s V_1 - IL_0037: call instance bool valuetype [runtime]System.Span`1/Enumerator::MoveNext() - IL_003c: brtrue.s IL_0022 - - IL_003e: leave.s IL_0041 - - } - finally - { - IL_0040: endfinally - } - IL_0041: ret - } """ ])) From 9b475078602919f9d48cc6862278b14d4aea92cd Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Aug 2025 17:40:55 +0200 Subject: [PATCH 08/10] Update SpanOptimizationTests.fs --- .../Compiler/Language/SpanOptimizationTests.fs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs index 877e1b7b337..47af33f3251 100644 --- a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs +++ b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs @@ -183,7 +183,22 @@ module Test = IL_0022: ldloca.s V_1 IL_0024: call instance !0& valuetype [runtime]System.Span`1/Enumerator::get_Current() - + IL_0029: stloc.3 + IL_002a: ldloc.3 + IL_002b: ldobj [runtime]System.Object + IL_0030: call void [runtime]System.Console::WriteLine(object) + IL_0035: ldloca.s V_1 + IL_0037: call instance bool valuetype [runtime]System.Span`1/Enumerator::MoveNext() + IL_003c: brtrue.s IL_0022 + + IL_003e: leave.s IL_004e + } + finally + { + IL_0040: ldloca.s V_1 + IL_0042: constrained. valuetype [runtime]System.Span`1/Enumerator + IL_0048: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_004d: endfinally """ ])) From aa15184072a2af046e72dfa201219d0d25fe0861 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Aug 2025 20:19:51 +0200 Subject: [PATCH 09/10] Update SpanOptimizationTests.fs --- tests/fsharp/Compiler/Language/SpanOptimizationTests.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs index 47af33f3251..12f381aa93c 100644 --- a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs +++ b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs @@ -192,13 +192,13 @@ module Test = IL_003c: brtrue.s IL_0022 IL_003e: leave.s IL_004e + } finally { IL_0040: ldloca.s V_1 IL_0042: constrained. valuetype [runtime]System.Span`1/Enumerator IL_0048: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_004d: endfinally """ ])) From c21bdb5d7c759823b3a5b85b0e46c97221771f8b Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 Aug 2025 10:47:13 +0200 Subject: [PATCH 10/10] adjust tests that need illink, Right now fails with: You must install or update .NET to run this application. App: C:\Users\tomasgrosup\.nuget\packages\microsoft.net.illink.tasks\10.0.0-preview.7.25380.108\tools\net\illink.dll Architecture: x64 Framework: 'Microsoft.NETCore.App', version '10.0.0-preview.7.25380.108' (x64) --- tests/AheadOfTime/Directory.Build.props | 6 ++++++ tests/AheadOfTime/Equality/Equality.fsproj | 2 +- tests/AheadOfTime/Equality/check.ps1 | 6 +++--- .../FSharpMetadataResource_Trimming_Test.fsproj | 2 +- .../SelfContained_Trimming_Test.fsproj | 2 +- .../StaticLinkedFSharpCore_Trimming_Test.fsproj | 2 +- tests/AheadOfTime/Trimming/check.ps1 | 12 ++++++------ 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/tests/AheadOfTime/Directory.Build.props b/tests/AheadOfTime/Directory.Build.props index bb5b23d29d0..07d33cd1374 100644 --- a/tests/AheadOfTime/Directory.Build.props +++ b/tests/AheadOfTime/Directory.Build.props @@ -1,3 +1,9 @@ + + $(NoWarn);NU1603 + + diff --git a/tests/AheadOfTime/Equality/Equality.fsproj b/tests/AheadOfTime/Equality/Equality.fsproj index 0283d8bf0da..166cdfa8e61 100644 --- a/tests/AheadOfTime/Equality/Equality.fsproj +++ b/tests/AheadOfTime/Equality/Equality.fsproj @@ -2,7 +2,7 @@ Exe - net10.0 + net9.0 preview true diff --git a/tests/AheadOfTime/Equality/check.ps1 b/tests/AheadOfTime/Equality/check.ps1 index 3aab08ef212..b98083d2635 100644 --- a/tests/AheadOfTime/Equality/check.ps1 +++ b/tests/AheadOfTime/Equality/check.ps1 @@ -1,6 +1,6 @@ -Write-Host "Publish and Execute: net10.0 - Equality" +Write-Host "Publish and Execute: net9.0 - Equality" -$build_output = dotnet publish -restore -c release -f:net10.0 $(Join-Path $PSScriptRoot Equality.fsproj) +$build_output = dotnet publish -restore -c release -f:net9.0 $(Join-Path $PSScriptRoot Equality.fsproj) # Checking that the build succeeded if ($LASTEXITCODE -ne 0) @@ -10,7 +10,7 @@ if ($LASTEXITCODE -ne 0) } $process = Start-Process ` - -FilePath $(Join-Path $PSScriptRoot bin\release\net10.0\win-x64\publish\Equality.exe) ` + -FilePath $(Join-Path $PSScriptRoot bin\release\net9.0\win-x64\publish\Equality.exe) ` -Wait ` -NoNewWindow ` -PassThru ` diff --git a/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj index 952812ab392..c02f7b56c2e 100644 --- a/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/FSharpMetadataResource_Trimming_Test/FSharpMetadataResource_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net10.0 + net9.0 preview true diff --git a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj index 0d38e74b246..e7b255d5986 100644 --- a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net10.0 + net9.0 preview true diff --git a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj index 1ff915b150a..6f6f8e2106d 100644 --- a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net10.0 + net9.0 preview true false diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1 index 6bf4366a71b..0a28df7529b 100644 --- a/tests/AheadOfTime/Trimming/check.ps1 +++ b/tests/AheadOfTime/Trimming/check.ps1 @@ -51,12 +51,12 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { # NOTE: Trimming now errors out on desktop TFMs, as shown below: # error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher. -# Check net10.0 trimmed assemblies -CheckTrim -root "SelfContained_Trimming_Test" -tfm "net10.0" -outputfile "FSharp.Core.dll" -expected_len 300032 +# Check net9.0 trimmed assemblies +CheckTrim -root "SelfContained_Trimming_Test" -tfm "net9.0" -outputfile "FSharp.Core.dll" -expected_len 300032 -# Check net10.0 trimmed assemblies with static linked FSharpCore -CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net10.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9154048 +# Check net9.0 trimmed assemblies with static linked FSharpCore +CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net9.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9154048 -# Check net10.0 trimmed assemblies with F# metadata resources removed -CheckTrim -root "FSharpMetadataResource_Trimming_Test" -tfm "net10.0" -outputfile "FSharpMetadataResource_Trimming_Test.dll" -expected_len 7601152 +# Check net9.0 trimmed assemblies with F# metadata resources removed +CheckTrim -root "FSharpMetadataResource_Trimming_Test" -tfm "net9.0" -outputfile "FSharpMetadataResource_Trimming_Test.dll" -expected_len 7601152