diff --git a/DEVGUIDE.md b/DEVGUIDE.md
index e5480e39ae0..f8029b45466 100644
--- a/DEVGUIDE.md
+++ b/DEVGUIDE.md
@@ -49,7 +49,7 @@ Install the latest released [Visual Studio](https://visualstudio.microsoft.com/v
* .NET desktop development (also check F# desktop support, as this will install some legacy templates)
* Visual Studio extension development
-You will also need the latest .NET 7 SDK installed from [here](https://dotnet.microsoft.com/download/dotnet/7.0).
+You will also need .NET SDK installed from [here](https://dotnet.microsoft.com/download/dotnet), exact version can be found in the global.json file in the root of the repository.
Building is simple:
@@ -76,7 +76,7 @@ If you are just developing the core compiler and library then building ``FSharp.
We recommend installing the latest Visual Studio preview and using that if you are on Windows. However, if you prefer not to do that, you will need to install the following:
* [.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)
-* [.NET 7](https://dotnet.microsoft.com/download/dotnet/7.0)
+* [.NET SDK](https://dotnet.microsoft.com/download/dotnet) (see exact version in global.json file in the repository root).
You'll need to pass an additional flag to the build script:
diff --git a/Directory.Build.props b/Directory.Build.props
index a1b18784e91..3dd057f702b 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -4,12 +4,12 @@
$(FSharpLangVersion)
$(MSBuildThisFileDirectory)
true
+ net8.0
@@ -21,25 +21,49 @@
true
-
+
- true
- true
false
true
true
$(MSBuildThisFileDirectory)artifacts/
$(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/
$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/
- $(ArtifactsDir)/bin/fslex/$(Configuration)/net8.0/fslex.dll
- $(ArtifactsDir)/bin/fsyacc/$(Configuration)/net8.0/fsyacc.dll
+
+ $(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fslex.dll
+ $(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fsyacc.dll
+ NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants)
+
-
+
+
+
+
+
+
+ $(NetCurrent)
+
+
+
+
+ $(FSharpNetCoreProductDefaultTargetFramework)
+
+
+
-
-
+
+
diff --git a/FSharp.Compiler.Service.sln b/FSharp.Compiler.Service.sln
index 45997f8a6db..957f7300e16 100644
--- a/FSharp.Compiler.Service.sln
+++ b/FSharp.Compiler.Service.sln
@@ -29,12 +29,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks",
tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 = tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1
EndProjectSection
EndProject
-Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}"
-EndProject
-Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Benchmarks", "tests\benchmarks\FCSBenchmarks\CompilerServiceBenchmarks\FSharp.Compiler.Benchmarks.fsproj", "{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}"
-EndProject
-Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HistoricalBenchmark.Runner", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.Runner\HistoricalBenchmark.Runner.fsproj", "{07CD957A-3C31-4F75-A735-16CE72E1BD71}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DD4D4A7E-D519-4409-89DA-16DCA3EF80AA}"
ProjectSection(SolutionItems) = preProject
src\Compiler\FSComp.txt = src\Compiler\FSComp.txt
@@ -61,8 +55,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Interactive
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}"
EndProject
-Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Benchmarks.Common", "tests\benchmarks\FSharp.Benchmarks.Common\FSharp.Benchmarks.Common.fsproj", "{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -97,18 +89,6 @@ Global
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.Build.0 = Release|Any CPU
- {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.ActiveCfg = Release|Any CPU
- {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.Build.0 = Release|Any CPU
- {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.Build.0 = Release|Any CPU
- {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.Build.0 = Release|Any CPU
- {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.Build.0 = Release|Any CPU
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -145,10 +125,6 @@ Global
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Release|Any CPU.Build.0 = Release|Any CPU
- {A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -157,10 +133,6 @@ Global
{BFE6E6F1-1B73-404F-A3A5-30B57E5E0731} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
{2EF674B9-8B56-4796-9933-42B2629E52C3} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
{38A23D53-E2BF-4B76-907F-49F41D60C88E} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
- {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
- {C1950E28-1CB7-4DEC-BB3A-8A0443A17282} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
- {07CD957A-3C31-4F75-A735-16CE72E1BD71} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
- {A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F9A60F3B-D894-4C8E-BA0F-C51115B25A5A}
diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props
index 03c26b4b075..2be5d4f2702 100644
--- a/FSharpTests.Directory.Build.props
+++ b/FSharpTests.Directory.Build.props
@@ -22,18 +22,18 @@
$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))
dotnet.exe
dotnet
- $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net8.0\fsc.dll
+ $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(FSharpNetCoreProductTargetFramework)\fsc.dll
$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))
dotnet.exe
dotnet
- $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net8.0\fsi.dll
+ $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\$(FSharpNetCoreProductTargetFramework)\fsi.dll
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472
- <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">net8.0
+ <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">$(FSharpNetCoreProductTargetFramework)
<_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework)
$(_FSharpBuildBinPath)\FSharp.Build.dll
diff --git a/README.md b/README.md
index 58a61e349e5..ee55e75dfad 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
You're invited to contribute to future releases of the F# compiler, core library, and tools. Development of this repository can be done on any OS supported by [.NET](https://dotnet.microsoft.com/).
-You will also need the latest .NET 7 SDK installed from [here](https://dotnet.microsoft.com/download/dotnet/7.0).
+You will also need .NET SDK installed from [here](https://dotnet.microsoft.com/download/dotnet), exact version can be found in the global.json file in the root of the repository.
## Contributing
diff --git a/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/buildtools/AssemblyCheck/AssemblyCheck.fsproj
index 46ffb722cd4..1f01406c734 100644
--- a/buildtools/AssemblyCheck/AssemblyCheck.fsproj
+++ b/buildtools/AssemblyCheck/AssemblyCheck.fsproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
false
diff --git a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj
index 514b1f4ddf6..8a0874bff6a 100644
--- a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj
+++ b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj
@@ -1,9 +1,9 @@
-
+
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
$(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid())
$(CachePath)\bin
diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj
index 674dde7c759..50c1e4e3668 100644
--- a/buildtools/fslex/fslex.fsproj
+++ b/buildtools/fslex/fslex.fsproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
false
LatestMajor
diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj
index fc072b7cf02..0cc67482b3a 100644
--- a/buildtools/fsyacc/fsyacc.fsproj
+++ b/buildtools/fsyacc/fsyacc.fsproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
false
LatestMajor
diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.202.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.202.md
new file mode 100644
index 00000000000..0780d447b5b
--- /dev/null
+++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.202.md
@@ -0,0 +1,3 @@
+### Fixed
+
+`nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16570](https://github.com/dotnet/fsharp/pull/16570), [PR #16747](https://github.com/dotnet/fsharp/pull/16747))
diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
index 672209d2ed1..786a741dbfa 100644
--- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
+++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
@@ -2,7 +2,7 @@
* Fix missing warning for recursive calls in list comprehensions. ([PR #16652](https://github.com/dotnet/fsharp/pull/16652))
* Code generated files with > 64K methods and generated symbols crash when loaded. Use infered sequence points for debugging. ([Issue #16399](https://github.com/dotnet/fsharp/issues/16399), [#PR 16514](https://github.com/dotnet/fsharp/pull/16514))
-* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16550](https://github.com/dotnet/fsharp/pull/16550))
+* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16550](https://github.com/dotnet/fsharp/pull/16550), [PR #16743](https://github.com/dotnet/fsharp/pull/16743))
* Graph Based Checking doesn't throw on invalid parsed input so it can be used for IDE scenarios ([PR #16575](https://github.com/dotnet/fsharp/pull/16575), [PR #16588](https://github.com/dotnet/fsharp/pull/16588), [PR #16643](https://github.com/dotnet/fsharp/pull/16643))
* Various parenthesization API fixes. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578), [PR #16666](https://github.com/dotnet/fsharp/pull/16666))
* Keep parens for problematic exprs (`if`, `match`, etc.) in `$"{(…):N0}"`, `$"{(…),-3}"`, etc. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578))
@@ -11,6 +11,7 @@
* `[]` member should not produce property symbol. ([Issue #16640](https://github.com/dotnet/fsharp/issues/16640), [PR #16658](https://github.com/dotnet/fsharp/pull/16658))
* Fix discriminated union initialization. ([#PR 16661](https://github.com/dotnet/fsharp/pull/16661))
* Allow calling method with both Optional and ParamArray. ([#PR 16688](https://github.com/dotnet/fsharp/pull/16688), [suggestions #1120](https://github.com/fsharp/fslang-suggestions/issues/1120))
+* Enforce AttributeTargets on let values and functions. ([PR #16692](https://github.com/dotnet/fsharp/pull/16692))
### Added
@@ -29,3 +30,4 @@
* Reduce allocations in compiler checking via `ValueOption` usage ([PR #16323](https://github.com/dotnet/fsharp/pull/16323), [PR #16567](https://github.com/dotnet/fsharp/pull/16567))
* Reverted [#16348](https://github.com/dotnet/fsharp/pull/16348) `ThreadStatic` `CancellationToken` changes to improve test stability and prevent potential unwanted cancellations. ([PR #16536](https://github.com/dotnet/fsharp/pull/16536))
* Refactored parenthesization API. ([PR #16461])(https://github.com/dotnet/fsharp/pull/16461))
+* Optimize some interpolated strings by lowering to string concatenation. ([PR #16556](https://github.com/dotnet/fsharp/pull/16556))
diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md
index 832dd924a44..f39dd172561 100644
--- a/docs/release-notes/.Language/preview.md
+++ b/docs/release-notes/.Language/preview.md
@@ -8,3 +8,8 @@
### Fixed
* Allow extension methods without type attribute work for types from imported assemblies. ([PR #16368](https://github.com/dotnet/fsharp/pull/16368))
+* Enforce AttributeTargets on let values and functions. ([PR #16692](https://github.com/dotnet/fsharp/pull/16692))
+
+### Changed
+
+* Lower interpolated strings to string concatenation. ([PR #16556](https://github.com/dotnet/fsharp/pull/16556))
diff --git a/docs/release-notes/FSharp.Core.fsx b/docs/release-notes/FSharp.Core.fsx
index 521ef4f630c..20fec5f86ed 100644
--- a/docs/release-notes/FSharp.Core.fsx
+++ b/docs/release-notes/FSharp.Core.fsx
@@ -1,4 +1,4 @@
-(** ---
+(** ---
category: Release Notes
categoryindex: 600
index: 3
@@ -14,7 +14,7 @@ open System.IO
open Markdig
open Common
-let path = Path.Combine(__SOURCE_DIRECTORY__, ".FSharp.Compiler.Service")
+let path = Path.Combine(__SOURCE_DIRECTORY__, ".FSharp.Core")
let nugetPackage = "FSharp.Core"
let availableNuGetVersions = getAvailableNuGetVersions nugetPackage
diff --git a/eng/Build.ps1 b/eng/Build.ps1
index fe7eb56a5b1..049ba91217d 100644
--- a/eng/Build.ps1
+++ b/eng/Build.ps1
@@ -36,6 +36,7 @@ param (
[switch][Alias('proto')]$bootstrap,
[string]$bootstrapConfiguration = "Proto",
[string]$bootstrapTfm = "net472",
+ [string]$fsharpNetCoreProductTfm = "net8.0",
[switch][Alias('bl')]$binaryLog = $true,
[switch][Alias('nobl')]$excludeCIBinaryLog = $false,
[switch][Alias('nolog')]$noBinaryLog = $false,
@@ -76,6 +77,9 @@ $ErrorActionPreference = "Stop"
$BuildCategory = ""
$BuildMessage = ""
+$desktopTargetFramework = "net472"
+$coreclrTargetFramework = "net8.0"
+
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration Build configuration: 'Debug' or 'Release' (short: -c)"
@@ -229,11 +233,11 @@ function Process-Arguments() {
function Update-Arguments() {
if ($script:noVisualStudio) {
- $script:bootstrapTfm = "net8.0"
+ $script:bootstrapTfm = $script:coreclrTargetFramework
$script:msbuildEngine = "dotnet"
}
- if ($bootstrapTfm -eq "net8.0") {
+ if ($bootstrapTfm -eq $script:coreclrTargetFramework) {
if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) {
$script:bootstrap = $True
}
@@ -255,7 +259,7 @@ function BuildSolution([string] $solutionName, $nopack) {
$officialBuildId = if ($official) { $env:BUILD_BUILDNUMBER } else { "" }
$toolsetBuildProj = InitializeToolset
$quietRestore = !$ci
- $testTargetFrameworks = if ($testCoreClr) { "net8.0" } else { "" }
+ $testTargetFrameworks = if ($testCoreClr) { $script:coreclrTargetFramework } else { "" }
# Do not set the property to true explicitly, since that would override value projects might set.
$suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" }
@@ -312,8 +316,8 @@ function UpdatePath() {
}
TestAndAddToPath $subdir
- TestAndAddToPath "$ArtifactsDir\bin\fsc\$configuration\net472"
- TestAndAddToPath "$ArtifactsDir\bin\fsiAnyCpu\$configuration\net472"
+ TestAndAddToPath "$ArtifactsDir\bin\fsc\$configuration\$script:desktopTargetFramework"
+ TestAndAddToPath "$ArtifactsDir\bin\fsiAnyCpu\$configuration\$script:desktopTargetFramework"
}
function VerifyAssemblyVersionsAndSymbols() {
@@ -565,18 +569,16 @@ try {
$script:BuildCategory = "Test"
$script:BuildMessage = "Failure running tests"
- $desktopTargetFramework = "net472"
- $coreclrTargetFramework = "net8.0"
if ($testCoreClr) {
- $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true
+ $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
- TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
+ TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
# Collect output from background jobs
Wait-job $bgJob | out-null
@@ -584,14 +586,14 @@ try {
}
if ($testDesktop) {
- $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true
+ $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
- TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
- TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
+ TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
+ TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
# Collect output from background jobs
Wait-job $bgJob | out-null
@@ -609,7 +611,7 @@ try {
UpdatePath
$env:HOSTED_COMPILER = 1
$env:CSC_PIPE = "$nugetPackages\Microsoft.Net.Compilers\4.3.0-1.22220.8\tools\csc.exe"
- $env:FSCOREDLLPATH = "$ArtifactsDir\bin\fsc\$configuration\net472\FSharp.Core.dll"
+ $env:FSCOREDLLPATH = "$ArtifactsDir\bin\fsc\$configuration\$script:desktopTargetFramework\FSharp.Core.dll"
$env:LINK_EXE = "$RepoRoot\tests\fsharpqa\testenv\bin\link\link.exe"
$env:OSARCH = $env:PROCESSOR_ARCHITECTURE
@@ -626,46 +628,46 @@ try {
}
if ($testFSharpCore) {
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
}
if ($testCompiler) {
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
- TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
- TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
+ TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
+ TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
}
if ($testCompilerComponentTests) {
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true
}
if ($testCompilerService) {
- TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
- TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
+ TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
+ TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
}
if ($testCambridge) {
- TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\"
- TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\"
+ TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\"
+ TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\"
}
if ($testScripting) {
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
- TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
}
if ($testVs -and -not $noVisualStudio) {
- TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj"
- TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\VisualFSharp.UnitTests\"
+ TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj"
+ TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\VisualFSharp.UnitTests\"
}
if ($testIntegration) {
- TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\"
+ TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\"
}
if ($testAOT) {
diff --git a/eng/DumpPackageRoot/DumpPackageRoot.csproj b/eng/DumpPackageRoot/DumpPackageRoot.csproj
index 5cbfdca4db5..da79505fcf1 100644
--- a/eng/DumpPackageRoot/DumpPackageRoot.csproj
+++ b/eng/DumpPackageRoot/DumpPackageRoot.csproj
@@ -3,7 +3,7 @@
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props
index 3ac9370d1a5..550215bd643 100644
--- a/eng/SourceBuild.props
+++ b/eng/SourceBuild.props
@@ -24,6 +24,10 @@
+
+
+ --tfm $(SourceBuildBootstrapTfm)
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 20b0a1ac716..c30f8e1630b 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -1,9 +1,9 @@
-
+
https://github.com/dotnet/source-build-reference-packages
- 2f79f97b7a6a0cf2ca3297a8fa526e6f4ea98ce2
+ 62fb9a85e5c4af657b0014fd6d6588c139d0bb4f
@@ -30,9 +30,9 @@
-
+
https://github.com/dotnet/arcade
- be88b08c41971b52ec11aec05ef31e72185d4a1f
+ da98edc4c3ea539f109ea320672136ceb32591a7
diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1
index a0c5299cb95..f73195c7ccd 100644
--- a/eng/build-utils.ps1
+++ b/eng/build-utils.ps1
@@ -14,6 +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 { "net8.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) {
@@ -230,7 +231,7 @@ function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string]
# Important to not set $script:bootstrapDir here yet as we're actually in the process of
# building the bootstrap.
function Make-BootstrapBuild() {
- Write-Host "Building bootstrap '$bootstrapTfm' compiler"
+ Write-Host "Building bootstrap '$bootstrapTfm' compiler with '$fsharpNetCoreProductTfm' .NET Core product TFM"
$dir = Join-Path $ArtifactsDir "Bootstrap"
Remove-Item -re $dir -ErrorAction SilentlyContinue
@@ -251,9 +252,9 @@ function Make-BootstrapBuild() {
}
Exec-Console $dotnetExe $args
- Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\net8.0" -Destination "$dir\fslex" -Force -Recurse
- Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\net8.0" -Destination "$dir\fsyacc" -Force -Recurse
- Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\net8.0" -Destination "$dir\AssemblyCheck" -Force -Recurse
+ Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\fslex" -Force -Recurse
+ Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\fsyacc" -Force -Recurse
+ Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\AssemblyCheck" -Force -Recurse
# prepare compiler
$protoProject = "`"$RepoRoot\proto.sln`""
diff --git a/eng/build.sh b/eng/build.sh
index b8915397d25..6e5d09b79d5 100755
--- a/eng/build.sh
+++ b/eng/build.sh
@@ -34,6 +34,7 @@ usage()
echo " --skipBuild Do not run the build"
echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
echo " --sourceBuild Simulate building for source-build"
+ echo " --tfm Override the default target framework"
echo ""
echo "Command line arguments starting with '/p:' are passed through to MSBuild."
}
@@ -72,6 +73,8 @@ properties=""
docker=false
args=""
+tfm="net8.0" # This needs to be changed every time it's bumped by arcade/us.
+
BuildCategory=""
BuildMessage=""
@@ -149,6 +152,10 @@ while [[ $# > 0 ]]; do
--sourcebuild)
source_build=true
;;
+ --tfm)
+ tfm=$2
+ shift
+ ;;
/p:*)
properties="$properties $1"
;;
@@ -269,8 +276,8 @@ function BuildSolution {
MSBuild "$repo_root/buildtools/buildtools.proj" /restore "$bltools" /p:Configuration=$bootstrap_config
mkdir -p "$bootstrap_dir"
- cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net8.0 $bootstrap_dir/fslex
- cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net8.0 $bootstrap_dir/fsyacc
+ cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/$tfm $bootstrap_dir/fslex
+ cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/$tfm $bootstrap_dir/fsyacc
fi
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
local bltools=""
@@ -279,7 +286,7 @@ function BuildSolution {
fi
BuildMessage="Error building bootstrap"
MSBuild "$repo_root/Proto.sln" /restore "$bltools" /p:Configuration=$bootstrap_config
- cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net8.0 $bootstrap_dir/fsc
+ cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/$tfm $bootstrap_dir/fsc
fi
fi
@@ -321,7 +328,7 @@ InitializeDotNetCli $restore
BuildSolution
if [[ "$test_core_clr" == true ]]; then
- coreclrtestframework=net8.0
+ coreclrtestframework=$tfm
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework --notestfilter
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework
@@ -331,7 +338,7 @@ if [[ "$test_core_clr" == true ]]; then
fi
if [[ "$test_compilercomponent_tests" == true ]]; then
- coreclrtestframework=net8.0
+ coreclrtestframework=$tfm
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter
fi
diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1
index 1e779fec4dd..5a3a32ea8d7 100644
--- a/eng/common/post-build/publish-using-darc.ps1
+++ b/eng/common/post-build/publish-using-darc.ps1
@@ -12,7 +12,7 @@ param(
try {
. $PSScriptRoot\post-build-utils.ps1
- $darc = Get-Darc
+ $darc = Get-Darc
$optionalParams = [System.Collections.ArrayList]::new()
@@ -46,7 +46,7 @@ try {
}
Write-Host 'done.'
-}
+}
catch {
Write-Host $_
Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to publish build '$BuildId' to default channels."
diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml
index fa5446c093d..8ec0151def2 100644
--- a/eng/common/templates/job/publish-build-assets.yml
+++ b/eng/common/templates/job/publish-build-assets.yml
@@ -58,7 +58,7 @@ jobs:
demands: Cmd
# If it's not devdiv, it's dnceng
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
- name: $(DncEngInternalBuildPool)
+ name: NetCore1ESPool-Publishing-Internal
demands: ImageOverride -equals windows.vs2019.amd64
steps:
@@ -71,7 +71,7 @@ jobs:
checkDownloadedFiles: true
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
-
+
- task: NuGetAuthenticate@1
- task: PowerShell@2
@@ -86,7 +86,7 @@ jobs:
/p:OfficialBuildId=$(Build.BuildNumber)
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
-
+
- task: powershell@2
displayName: Create ReleaseConfigs Artifact
inputs:
@@ -95,7 +95,7 @@ jobs:
Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId)
Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)"
Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild)
-
+
- task: PublishBuildArtifacts@1
displayName: Publish ReleaseConfigs Artifact
inputs:
@@ -121,7 +121,7 @@ jobs:
- task: PublishBuildArtifacts@1
displayName: Publish SymbolPublishingExclusionsFile Artifact
- condition: eq(variables['SymbolExclusionFile'], 'true')
+ condition: eq(variables['SymbolExclusionFile'], 'true')
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt'
PublishLocation: Container
@@ -137,7 +137,7 @@ jobs:
displayName: Publish Using Darc
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
- arguments: -BuildId $(BARBuildId)
+ arguments: -BuildId $(BARBuildId)
-PublishingInfraVersion 3
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
-MaestroToken '$(MaestroApiAccessToken)'
@@ -148,4 +148,4 @@ jobs:
- ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}:
- template: /eng/common/templates/steps/publish-logs.yml
parameters:
- JobLabel: 'Publish_Artifacts_Logs'
+ JobLabel: 'Publish_Artifacts_Logs'
diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml
index 3f74abf7ce0..aba44a25a33 100644
--- a/eng/common/templates/post-build/post-build.yml
+++ b/eng/common/templates/post-build/post-build.yml
@@ -39,7 +39,7 @@ parameters:
displayName: Enable NuGet validation
type: boolean
default: true
-
+
- name: publishInstallersAndChecksums
displayName: Publish installers and checksums
type: boolean
@@ -131,8 +131,8 @@ stages:
displayName: Validate
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1
- arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/
- -ToolDestinationPath $(Agent.BuildDirectory)/Extract/
+ arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/
+ -ToolDestinationPath $(Agent.BuildDirectory)/Extract/
- job:
displayName: Signing Validation
@@ -221,9 +221,9 @@ stages:
displayName: Validate
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
- arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/
- -ExtractPath $(Agent.BuildDirectory)/Extract/
- -GHRepoName $(Build.Repository.Name)
+ arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/
+ -ExtractPath $(Agent.BuildDirectory)/Extract/
+ -GHRepoName $(Build.Repository.Name)
-GHCommit $(Build.SourceVersion)
-SourcelinkCliVersion $(SourceLinkCLIVersion)
continueOnError: true
@@ -258,7 +258,7 @@ stages:
demands: Cmd
# If it's not devdiv, it's dnceng
${{ else }}:
- name: $(DncEngInternalBuildPool)
+ name: NetCore1ESPool-Publishing-Internal
demands: ImageOverride -equals windows.vs2019.amd64
steps:
- template: setup-maestro-vars.yml
@@ -272,7 +272,7 @@ stages:
displayName: Publish Using Darc
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
- arguments: -BuildId $(BARBuildId)
+ arguments: -BuildId $(BARBuildId)
-PublishingInfraVersion ${{ parameters.publishingInfraVersion }}
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
-MaestroToken '$(MaestroApiAccessToken)'
diff --git a/eng/common/templates/variables/pool-providers.yml b/eng/common/templates/variables/pool-providers.yml
index 9cc5c550d3b..d236f9fdbb1 100644
--- a/eng/common/templates/variables/pool-providers.yml
+++ b/eng/common/templates/variables/pool-providers.yml
@@ -1,15 +1,15 @@
-# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool,
+# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool,
# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches.
-# Motivation:
+# Motivation:
# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS
# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing
# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS.
-# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services
-# team needs to move resources around and create new and potentially differently-named pools. Using this template
+# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services
+# team needs to move resources around and create new and potentially differently-named pools. Using this template
# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming.
-# How to use:
+# How to use:
# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do).
# If we find alternate naming conventions in broad usage it can be added to the condition below.
#
@@ -54,4 +54,4 @@ variables:
False,
'NetCore1ESPool-Internal'
)
- ]
\ No newline at end of file
+ ]
diff --git a/eng/test-determinism.ps1 b/eng/test-determinism.ps1
index 5b9a079f078..499c1187a0d 100644
--- a/eng/test-determinism.ps1
+++ b/eng/test-determinism.ps1
@@ -378,9 +378,10 @@ try {
$script:bootstrap = $true
$script:bootstrapConfiguration = "Proto"
$script:bootstrapTfm = "net472"
+ $script:fsharpNetCoreProductTfm = "net8.0"
if ($script:msbuildEngine -eq "dotnet") {
- $script.bootstrapTfm = "net8.0"
+ $script.bootstrapTfm = $script:fsharpNetCoreProductTfm
}
$bootstrapDir = Make-BootstrapBuild
diff --git a/fcs-samples/EditorService/EditorService.fsproj b/fcs-samples/EditorService/EditorService.fsproj
index e4103999fcb..214bb75afc9 100644
--- a/fcs-samples/EditorService/EditorService.fsproj
+++ b/fcs-samples/EditorService/EditorService.fsproj
@@ -1,7 +1,7 @@
- $(FcsTargetNetFxFramework);net8.0
+ $(FcsTargetNetFxFramework);$(FSharpNetCoreProductTargetFramework)
true
Exe
false
diff --git a/global.json b/global.json
index 57b76f86929..1f759399b06 100644
--- a/global.json
+++ b/global.json
@@ -17,7 +17,7 @@
"perl": "5.38.0.1"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24081.5",
+ "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24113.2",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
}
}
diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs
index e59fb6bd5ff..3e3e90a72fe 100644
--- a/src/Compiler/Checking/CheckExpressions.fs
+++ b/src/Compiler/Checking/CheckExpressions.fs
@@ -6,6 +6,7 @@ module internal FSharp.Compiler.CheckExpressions
open System
open System.Collections.Generic
+open System.Text.RegularExpressions
open Internal.Utilities.Collections
open Internal.Utilities.Library
@@ -140,6 +141,43 @@ exception StandardOperatorRedefinitionWarning of string * range
exception InvalidInternalsVisibleToAssemblyName of badName: string * fileName: string option
+//----------------------------------------------------------------------------------------------
+// Helpers for determining if/what specifiers a string has.
+// Used to decide if interpolated string can be lowered to a concat call.
+// We don't care about single- vs multi-$ strings here, because lexer took care of that already.
+//----------------------------------------------------------------------------------------------
+[]
+let (|HasFormatSpecifier|_|) (s: string) =
+ if
+ Regex.IsMatch(
+ s,
+ // Regex pattern for something like: %[flags][width][.precision][type]
+ """
+ (^|[^%]) # Start with beginning of string or any char other than '%'
+ (%%)*% # followed by an odd number of '%' chars
+ [+-0 ]{0,3} # optionally followed by flags
+ (\d+)? # optionally followed by width
+ (\.\d+)? # optionally followed by .precision
+ [bscdiuxXoBeEfFgGMOAat] # and then a char that determines specifier's type
+ """,
+ RegexOptions.Compiled ||| RegexOptions.IgnorePatternWhitespace)
+ then
+ ValueSome HasFormatSpecifier
+ else
+ ValueNone
+
+// Removes trailing "%s" unless it was escaped by another '%' (checks for odd sequence of '%' before final "%s")
+let (|WithTrailingStringSpecifierRemoved|) (s: string) =
+ if s.EndsWith "%s" then
+ let i = s.AsSpan(0, s.Length - 2).LastIndexOfAnyExcept '%'
+ let diff = s.Length - 2 - i
+ if diff &&& 1 <> 0 then
+ s[..i]
+ else
+ s
+ else
+ s
+
/// Compute the available access rights from a particular location in code
let ComputeAccessRights eAccessPath eInternalsVisibleCompPaths eFamilyType =
AccessibleFrom (eAccessPath :: eInternalsVisibleCompPaths, eFamilyType)
@@ -7336,25 +7374,68 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
// Type check the expressions filling the holes
let fillExprs, tpenv = TcExprsNoFlexes cenv env m tpenv argTys synFillExprs
- let fillExprsBoxed = (argTys, fillExprs) ||> List.map2 (mkCallBox g m)
+ // Take all interpolated string parts and typed fill expressions
+ // and convert them to typed expressions that can be used as args to System.String.Concat
+ // return an empty list if there are some format specifiers that make lowering to not applicable
+ let rec concatenable acc fillExprs parts =
+ match fillExprs, parts with
+ | [], [] ->
+ List.rev acc
+ | [], SynInterpolatedStringPart.FillExpr _ :: _
+ | _, [] ->
+ // This should never happen, there will always be as many typed fill expressions
+ // as there are FillExprs in the interpolated string parts
+ error(InternalError("Mismatch in interpolation expression count", m))
+ | _, SynInterpolatedStringPart.String (WithTrailingStringSpecifierRemoved "", _) :: parts ->
+ // If the string is empty (after trimming %s of the end), we skip it
+ concatenable acc fillExprs parts
+
+ | _, SynInterpolatedStringPart.String (WithTrailingStringSpecifierRemoved HasFormatSpecifier, _) :: _
+ | _, SynInterpolatedStringPart.FillExpr (_, Some _) :: _
+ | _, SynInterpolatedStringPart.FillExpr (SynExpr.Tuple (isStruct = false; exprs = [_; SynExpr.Const (SynConst.Int32 _, _)]), _) :: _ ->
+ // There was a format specifier like %20s{..} or {..,20} or {x:hh}, which means we cannot simply concat
+ []
- let argsExpr = mkArray (g.obj_ty, fillExprsBoxed, m)
- let percentATysExpr =
- if percentATys.Length = 0 then
- mkNull m (mkArrayType g g.system_Type_ty)
- else
- let tyExprs = percentATys |> Array.map (mkCallTypeOf g m) |> Array.toList
- mkArray (g.system_Type_ty, tyExprs, m)
+ | _, SynInterpolatedStringPart.String (s & WithTrailingStringSpecifierRemoved trimmed, m) :: parts ->
+ let finalStr = trimmed.Replace("%%", "%")
+ concatenable (mkString g (shiftEnd 0 (finalStr.Length - s.Length) m) finalStr :: acc) fillExprs parts
- let fmtExpr = MakeMethInfoCall cenv.amap m newFormatMethod [] [mkString g m printfFormatString; argsExpr; percentATysExpr] None
+ | fillExpr :: fillExprs, SynInterpolatedStringPart.FillExpr _ :: parts ->
+ concatenable (fillExpr :: acc) fillExprs parts
- if isString then
- TcPropagatingExprLeafThenConvert cenv overallTy g.string_ty env (* true *) m (fun () ->
- // Make the call to sprintf
- mkCall_sprintf g m printerTy fmtExpr [], tpenv
- )
- else
- fmtExpr, tpenv
+ let canLower =
+ g.langVersion.SupportsFeature LanguageFeature.LowerInterpolatedStringToConcat
+ && isString
+ && argTys |> List.forall (isStringTy g)
+
+ let concatenableExprs = if canLower then concatenable [] fillExprs parts else []
+
+ match concatenableExprs with
+ | [p1; p2; p3; p4] -> mkStaticCall_String_Concat4 g m p1 p2 p3 p4, tpenv
+ | [p1; p2; p3] -> mkStaticCall_String_Concat3 g m p1 p2 p3, tpenv
+ | [p1; p2] -> mkStaticCall_String_Concat2 g m p1 p2, tpenv
+ | [p1] -> p1, tpenv
+ | _ ->
+
+ let fillExprsBoxed = (argTys, fillExprs) ||> List.map2 (mkCallBox g m)
+
+ let argsExpr = mkArray (g.obj_ty, fillExprsBoxed, m)
+ let percentATysExpr =
+ if percentATys.Length = 0 then
+ mkNull m (mkArrayType g g.system_Type_ty)
+ else
+ let tyExprs = percentATys |> Array.map (mkCallTypeOf g m) |> Array.toList
+ mkArray (g.system_Type_ty, tyExprs, m)
+
+ let fmtExpr = MakeMethInfoCall cenv.amap m newFormatMethod [] [mkString g m printfFormatString; argsExpr; percentATysExpr] None
+
+ if isString then
+ TcPropagatingExprLeafThenConvert cenv overallTy g.string_ty env (* true *) m (fun () ->
+ // Make the call to sprintf
+ mkCall_sprintf g m printerTy fmtExpr [], tpenv
+ )
+ else
+ fmtExpr, tpenv
// The case for $"..." used as type FormattableString or IFormattable
| Choice2Of2 createFormattableStringMethod ->
@@ -10555,8 +10636,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt
| ModuleOrMemberBinding, SynBindingKind.StandaloneExpression, _ -> Some(".cctor")
| _, _, _ -> envinner.eCallerMemberName
- let envinner = {envinner with eCallerMemberName = callerName }
-
+ let envinner = { envinner with eCallerMemberName = callerName }
let attrTgt = declKind.AllowedAttribTargets memberFlagsOpt
let isFixed, rhsExpr, overallPatTy, overallExprTy =
@@ -10792,6 +10872,16 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt
errorR(Error(FSComp.SR.tcLiteralCannotBeInline(), mBinding))
if not (isNil declaredTypars) then
errorR(Error(FSComp.SR.tcLiteralCannotHaveGenericParameters(), mBinding))
+
+ if g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargetsOnFunctions) && memberFlagsOpt.IsNone && not attrs.IsEmpty then
+ let rhsIsFunction = isFunTy g overallPatTy
+ let lhsIsFunction = isFunTy g overallExprTy
+ let attrTgt =
+ match rhsIsFunction, lhsIsFunction with
+ | false, false when declaredTypars.IsEmpty -> AttributeTargets.Field ||| AttributeTargets.Property ||| AttributeTargets.ReturnValue
+ | _, _ -> AttributeTargets.Method ||| AttributeTargets.ReturnValue
+
+ TcAttributesWithPossibleTargets false cenv env attrTgt attrs |> ignore
CheckedBindingInfo(inlineFlag, valAttribs, xmlDoc, tcPatPhase2, explicitTyparInfo, nameToPrelimValSchemeMap, rhsExprChecked, argAndRetAttribs, overallPatTy, mBinding, debugPoint, isCompGen, literalValue, isFixed), tpenv
diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs
index c26683e3da9..ce6ab702bdc 100644
--- a/src/Compiler/Checking/TailCallChecks.fs
+++ b/src/Compiler/Checking/TailCallChecks.fs
@@ -725,12 +725,7 @@ let CheckModuleBinding cenv (isRec: bool) (TBind _ as bind) =
// warn for non-rec functions which have the attribute
if cenv.g.langVersion.SupportsFeature LanguageFeature.WarningWhenTailCallAttrOnNonRec then
- let isNotAFunction =
- match bind.Var.ValReprInfo with
- | Some info -> info.HasNoArgs
- | _ -> false
-
- if (not isRec || isNotAFunction) && cenv.g.HasTailCallAttrib bind.Var.Attribs then
+ if not isRec && cenv.g.HasTailCallAttrib bind.Var.Attribs then
warning (Error(FSComp.SR.chkTailCallAttrOnNonRec (), bind.Var.Range))
// Check if a let binding to the result of a rec expression is not inside the rec expression
diff --git a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs
index 15355de5a30..c19edc6ac57 100644
--- a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs
+++ b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs
@@ -310,8 +310,27 @@ let visitSynTypeConstraint (tc: SynTypeConstraint) : FileContentEntry list =
let inline (|NameofIdent|_|) (ident: Ident) =
if ident.idText = "nameof" then ValueSome() else ValueNone
+/// nameof X.Y.Z can be used in expressions and patterns
+[]
+type NameofResult =
+ /// Example: nameof X
+ /// Where X is a module name
+ | SingleIdent of potentialModuleName: Ident
+ /// Example: nameof X.Y.Z
+ /// Where Z is either a module name or something from inside module or namespace Y.
+ /// Both options need to be explored.
+ | LongIdent of longIdent: LongIdent
+
+let visitNameofResult (nameofResult: NameofResult) : FileContentEntry =
+ match nameofResult with
+ | NameofResult.SingleIdent moduleName -> visitIdentAsPotentialModuleName moduleName
+ | NameofResult.LongIdent longIdent ->
+ // In this case the last part of the LongIdent could be a module name.
+ // So we should not cut off the last part.
+ FileContentEntry.PrefixedIdentifier(longIdentToPath false longIdent)
+
/// Special case of `nameof Module` type of expression
-let (|NameofExpr|_|) (e: SynExpr) =
+let (|NameofExpr|_|) (e: SynExpr) : NameofResult option =
let rec stripParen (e: SynExpr) =
match e with
| SynExpr.Paren(expr = expr) -> stripParen expr
@@ -320,14 +339,20 @@ let (|NameofExpr|_|) (e: SynExpr) =
match e with
| SynExpr.App(flag = ExprAtomicFlag.NonAtomic; isInfix = false; funcExpr = SynExpr.Ident NameofIdent; argExpr = moduleNameExpr) ->
match stripParen moduleNameExpr with
- | SynExpr.Ident moduleNameIdent -> Some moduleNameIdent
+ | SynExpr.Ident moduleNameIdent -> Some(NameofResult.SingleIdent moduleNameIdent)
+ | SynExpr.LongIdent(longDotId = longIdent) ->
+ match longIdent.LongIdent with
+ | [] -> None
+ // This is highly unlikely to be produced by the parser
+ | [ moduleNameIdent ] -> Some(NameofResult.SingleIdent moduleNameIdent)
+ | lid -> Some(NameofResult.LongIdent(lid))
| _ -> None
| _ -> None
let visitSynExpr (e: SynExpr) : FileContentEntry list =
let rec visit (e: SynExpr) (continuation: FileContentEntry list -> FileContentEntry list) : FileContentEntry list =
match e with
- | NameofExpr moduleNameIdent -> continuation [ visitIdentAsPotentialModuleName moduleNameIdent ]
+ | NameofExpr nameofResult -> continuation [ visitNameofResult nameofResult ]
| SynExpr.Const _ -> continuation []
| SynExpr.Paren(expr = expr) -> visit expr continuation
| SynExpr.Quote(operator = operator; quotedExpr = quotedExpr) ->
@@ -551,18 +576,22 @@ let (|NameofPat|_|) (pat: SynPat) =
| SynPat.LongIdent(longDotId = SynLongIdent(id = [ NameofIdent ]); typarDecls = None; argPats = SynArgPats.Pats [ moduleNamePat ]) ->
match stripPats moduleNamePat with
| SynPat.LongIdent(
- longDotId = SynLongIdent.SynLongIdent(id = [ moduleNameIdent ]; dotRanges = []; trivia = [ None ])
+ longDotId = SynLongIdent.SynLongIdent(id = longIdent)
extraId = None
typarDecls = None
argPats = SynArgPats.Pats []
- accessibility = None) -> Some moduleNameIdent
+ accessibility = None) ->
+ match longIdent with
+ | [] -> None
+ | [ moduleNameIdent ] -> Some(NameofResult.SingleIdent moduleNameIdent)
+ | lid -> Some(NameofResult.LongIdent lid)
| _ -> None
| _ -> None
let visitPat (p: SynPat) : FileContentEntry list =
let rec visit (p: SynPat) (continuation: FileContentEntry list -> FileContentEntry list) : FileContentEntry list =
match p with
- | NameofPat moduleNameIdent -> continuation [ visitIdentAsPotentialModuleName moduleNameIdent ]
+ | NameofPat moduleNameIdent -> continuation [ visitNameofResult moduleNameIdent ]
| SynPat.Paren(pat = pat) -> visit pat continuation
| SynPat.Typed(pat = pat; targetType = t) -> visit pat (fun nodes -> nodes @ visitSynType t)
| SynPat.Const _ -> continuation []
diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt
index a9fc2692157..a1086629fbe 100644
--- a/src/Compiler/FSComp.txt
+++ b/src/Compiler/FSComp.txt
@@ -1594,6 +1594,8 @@ featureWarningIndexedPropertiesGetSetSameType,"Indexed properties getter and set
featureChkTailCallAttrOnNonRec,"Raises warnings if the 'TailCall' attribute is used on non-recursive functions."
featureUnionIsPropertiesVisible,"Union case test properties"
featureBooleanReturningAndReturnTypeDirectedPartialActivePattern,"Boolean-returning and return-type-directed partial active patterns"
+featureEnforceAttributeTargetsOnFunctions,"Enforce AttributeTargets on functions"
+featureLowerInterpolatedStringToConcat,"Optimizes interpolated strings in certain cases, by lowering to concatenation"
3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
3355,tcNotAnIndexerNamedIndexingNotYetEnabled,"The value '%s' is not a function and does not support index notation."
diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj
index dd7b6e25c1a..6a52de46022 100644
--- a/src/Compiler/FSharp.Compiler.Service.fsproj
+++ b/src/Compiler/FSharp.Compiler.Service.fsproj
@@ -543,15 +543,15 @@
- TargetFramework=net8.0
+ TargetFramework=$(FSharpNetCoreProductTargetFramework)
compile
- TargetFramework=net8.0
+ TargetFramework=$(FSharpNetCoreProductTargetFramework)
compile
- TargetFramework=net8.0
+ TargetFramework=$(FSharpNetCoreProductTargetFramework)
compile
diff --git a/src/Compiler/Facilities/AsyncMemoize.fs b/src/Compiler/Facilities/AsyncMemoize.fs
index b780d91ca74..d6ae83ada6e 100644
--- a/src/Compiler/Facilities/AsyncMemoize.fs
+++ b/src/Compiler/Facilities/AsyncMemoize.fs
@@ -534,6 +534,15 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T
}
+ member _.TryGet(key: 'TKey, predicate: 'TVersion -> bool) : 'TValue option =
+ let versionsAndJobs = cache.GetAll(key)
+
+ versionsAndJobs
+ |> Seq.tryPick (fun (version, job) ->
+ match predicate version, job with
+ | true, Completed(completed, _) -> Some completed
+ | _ -> None)
+
member _.Clear() = cache.Clear()
member _.Clear predicate = cache.Clear predicate
diff --git a/src/Compiler/Facilities/AsyncMemoize.fsi b/src/Compiler/Facilities/AsyncMemoize.fsi
index a34588e7af8..1cce68cf999 100644
--- a/src/Compiler/Facilities/AsyncMemoize.fsi
+++ b/src/Compiler/Facilities/AsyncMemoize.fsi
@@ -69,6 +69,8 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T
member Get': key: 'TKey * computation: NodeCode<'TValue> -> NodeCode<'TValue>
+ member TryGet: key: 'TKey * predicate: ('TVersion -> bool) -> 'TValue option
+
member Event: IEvent
member OnEvent: ((JobEvent * (string * 'TKey * 'TVersion) -> unit) -> unit)
diff --git a/src/Compiler/Facilities/BuildGraph.fs b/src/Compiler/Facilities/BuildGraph.fs
index 71f4d3da991..b4abe3ad1ed 100644
--- a/src/Compiler/Facilities/BuildGraph.fs
+++ b/src/Compiler/Facilities/BuildGraph.fs
@@ -25,6 +25,8 @@ let wrapThreadStaticInfo computation =
DiagnosticsThreadStatics.BuildPhase <- phase
}
+let unwrapNode (Node(computation)) = computation
+
type Async<'T> with
static member AwaitNodeCode(node: NodeCode<'T>) =
@@ -193,19 +195,28 @@ type NodeCode private () =
}
static member Parallel(computations: NodeCode<'T> seq) =
- let diagnosticsLogger = DiagnosticsThreadStatics.DiagnosticsLogger
- let phase = DiagnosticsThreadStatics.BuildPhase
+ node {
+ let concurrentLogging = new CaptureDiagnosticsConcurrently()
+ let phase = DiagnosticsThreadStatics.BuildPhase
+ // Why does it return just IDisposable?
+ use _ = concurrentLogging
- computations
- |> Seq.map (fun (Node x) ->
- async {
- DiagnosticsThreadStatics.DiagnosticsLogger <- diagnosticsLogger
- DiagnosticsThreadStatics.BuildPhase <- phase
- return! x
- })
- |> Async.Parallel
- |> wrapThreadStaticInfo
- |> Node
+ let injectLogger i computation =
+ let logger = concurrentLogging.GetLoggerForTask($"NodeCode.Parallel {i}")
+
+ async {
+ DiagnosticsThreadStatics.DiagnosticsLogger <- logger
+ DiagnosticsThreadStatics.BuildPhase <- phase
+ return! unwrapNode computation
+ }
+
+ return!
+ computations
+ |> Seq.mapi injectLogger
+ |> Async.Parallel
+ |> wrapThreadStaticInfo
+ |> Node
+ }
[]
module GraphNode =
diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs
index 08a46d1a25d..75dfaaef39e 100644
--- a/src/Compiler/Facilities/DiagnosticsLogger.fs
+++ b/src/Compiler/Facilities/DiagnosticsLogger.fs
@@ -13,6 +13,7 @@ open System.Reflection
open System.Threading
open Internal.Utilities.Library
open Internal.Utilities.Library.Extras
+open System.Collections.Concurrent
/// Represents the style being used to format errors
[]
@@ -883,3 +884,17 @@ type StackGuard(maxDepth: int, name: string) =
static member GetDepthOption(name: string) =
GetEnvInteger ("FSHARP_" + name + "StackGuardDepth") StackGuard.DefaultDepth
+
+type CaptureDiagnosticsConcurrently() =
+ let target = DiagnosticsThreadStatics.DiagnosticsLogger
+ let loggers = ResizeArray()
+
+ member _.GetLoggerForTask(name) : DiagnosticsLogger =
+ let logger = CapturingDiagnosticsLogger(name)
+ loggers.Add logger
+ logger
+
+ interface IDisposable with
+ member _.Dispose() =
+ for logger in loggers do
+ logger.CommitDelayedDiagnostics target
diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi
index e9040da36ed..bcbdd197b73 100644
--- a/src/Compiler/Facilities/DiagnosticsLogger.fsi
+++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi
@@ -463,3 +463,10 @@ type CompilationGlobalsScope =
member DiagnosticsLogger: DiagnosticsLogger
member BuildPhase: BuildPhase
+
+type CaptureDiagnosticsConcurrently =
+ new: unit -> CaptureDiagnosticsConcurrently
+
+ member GetLoggerForTask: string -> DiagnosticsLogger
+
+ interface IDisposable
diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs
index e7c2a25ee3d..6e2d91bc6cd 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fs
+++ b/src/Compiler/Facilities/LanguageFeatures.fs
@@ -85,6 +85,8 @@ type LanguageFeature =
| WarningIndexedPropertiesGetSetSameType
| WarningWhenTailCallAttrOnNonRec
| BooleanReturningAndReturnTypeDirectedPartialActivePattern
+ | EnforceAttributeTargetsOnFunctions
+ | LowerInterpolatedStringToConcat
/// LanguageVersion management
type LanguageVersion(versionText) =
@@ -197,6 +199,8 @@ type LanguageVersion(versionText) =
LanguageFeature.WarningWhenTailCallAttrOnNonRec, previewVersion
LanguageFeature.UnionIsPropertiesVisible, previewVersion
LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern, previewVersion
+ LanguageFeature.EnforceAttributeTargetsOnFunctions, previewVersion
+ LanguageFeature.LowerInterpolatedStringToConcat, previewVersion
]
static let defaultLanguageVersion = LanguageVersion("default")
@@ -340,6 +344,8 @@ type LanguageVersion(versionText) =
| LanguageFeature.WarningWhenTailCallAttrOnNonRec -> FSComp.SR.featureChkTailCallAttrOnNonRec ()
| LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern ->
FSComp.SR.featureBooleanReturningAndReturnTypeDirectedPartialActivePattern ()
+ | LanguageFeature.EnforceAttributeTargetsOnFunctions -> FSComp.SR.featureEnforceAttributeTargetsOnFunctions ()
+ | LanguageFeature.LowerInterpolatedStringToConcat -> FSComp.SR.featureLowerInterpolatedStringToConcat ()
/// Get a version string associated with the given feature.
static member GetFeatureVersionString feature =
diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi
index 29d6c2c33a3..4888479d867 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fsi
+++ b/src/Compiler/Facilities/LanguageFeatures.fsi
@@ -76,6 +76,8 @@ type LanguageFeature =
| WarningIndexedPropertiesGetSetSameType
| WarningWhenTailCallAttrOnNonRec
| BooleanReturningAndReturnTypeDirectedPartialActivePattern
+ | EnforceAttributeTargetsOnFunctions
+ | LowerInterpolatedStringToConcat
/// LanguageVersion management
type LanguageVersion =
diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs
index f9f952dde70..d0af1284f14 100644
--- a/src/Compiler/Service/BackgroundCompiler.fs
+++ b/src/Compiler/Service/BackgroundCompiler.fs
@@ -123,6 +123,20 @@ type internal IBackgroundCompiler =
userOpName: string ->
Async
+ abstract GetProjectSnapshotFromScript:
+ fileName: string *
+ sourceText: ISourceTextNew *
+ previewEnabled: bool option *
+ loadedTimeStamp: System.DateTime option *
+ otherFlags: string array option *
+ useFsiAuxLib: bool option *
+ useSdkRefs: bool option *
+ sdkDirOverride: string option *
+ assumeDotNetFramework: bool option *
+ optionsStamp: int64 option *
+ userOpName: string ->
+ Async
+
abstract member GetSemanticClassificationForFile:
fileName: string * options: FSharpProjectOptions * userOpName: string ->
NodeCode
@@ -133,6 +147,8 @@ type internal IBackgroundCompiler =
abstract member InvalidateConfiguration: options: FSharpProjectOptions * userOpName: string -> unit
+ abstract InvalidateConfiguration: projectSnapshot: FSharpProjectSnapshot * userOpName: string -> unit
+
abstract member NotifyFileChanged: fileName: string * options: FSharpProjectOptions * userOpName: string -> NodeCode
abstract member NotifyProjectCleaned: options: FSharpProjectOptions * userOpName: string -> Async
@@ -163,6 +179,10 @@ type internal IBackgroundCompiler =
fileName: string * options: FSharpProjectOptions * sourceText: ISourceText option * userOpName: string ->
(FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option
+ abstract member TryGetRecentCheckResultsForFile:
+ fileName: string * projectSnapshot: FSharpProjectSnapshot * userOpName: string ->
+ (FSharpParseFileResults * FSharpCheckFileResults) option
+
abstract member BeforeBackgroundFileCheck: IEvent
abstract member FileChecked: IEvent
@@ -1158,6 +1178,16 @@ type internal BackgroundCompiler
| None -> None
| None -> None
+ member _.TryGetRecentCheckResultsForFile(fileName: string, projectSnapshot: FSharpProjectSnapshot, userOpName: string) =
+ projectSnapshot.ProjectSnapshot.SourceFiles
+ |> List.tryFind (fun f -> f.FileName = fileName)
+ |> Option.bind (fun (f: FSharpFileSnapshot) ->
+ let options = projectSnapshot.ToOptions()
+ let sourceText = f.GetSource() |> Async.AwaitTask |> Async.RunSynchronously
+
+ self.TryGetRecentCheckResultsForFile(fileName, options, Some sourceText, userOpName)
+ |> Option.map (fun (parseFileResults, checkFileResults, _hash) -> (parseFileResults, checkFileResults)))
+
/// Parse and typecheck the whole project (the implementation, called recursively as project graph is evaluated)
member private _.ParseAndCheckProjectImpl(options, userOpName) =
node {
@@ -1593,6 +1623,40 @@ type internal BackgroundCompiler
userOpName
)
+ member _.GetProjectSnapshotFromScript
+ (
+ fileName: string,
+ sourceText: ISourceTextNew,
+ previewEnabled: bool option,
+ loadedTimeStamp: DateTime option,
+ otherFlags: string array option,
+ useFsiAuxLib: bool option,
+ useSdkRefs: bool option,
+ sdkDirOverride: string option,
+ assumeDotNetFramework: bool option,
+ optionsStamp: int64 option,
+ userOpName: string
+ ) : Async =
+ async {
+ let! options, diagnostics =
+ self.GetProjectOptionsFromScript(
+ fileName,
+ sourceText,
+ previewEnabled,
+ loadedTimeStamp,
+ otherFlags,
+ useFsiAuxLib,
+ useSdkRefs,
+ sdkDirOverride,
+ assumeDotNetFramework,
+ optionsStamp,
+ userOpName
+ )
+
+ let! snapshot = FSharpProjectSnapshot.FromOptions(options, DocumentSource.FileSystem)
+ return snapshot, diagnostics
+ }
+
member _.GetSemanticClassificationForFile
(
fileName: string,
@@ -1612,6 +1676,10 @@ type internal BackgroundCompiler
member _.InvalidateConfiguration(options: FSharpProjectOptions, userOpName: string) : unit =
self.InvalidateConfiguration(options, userOpName)
+ member this.InvalidateConfiguration(projectSnapshot: FSharpProjectSnapshot, userOpName: string) : unit =
+ let options = projectSnapshot.ToOptions()
+ self.InvalidateConfiguration(options, userOpName)
+
member _.NotifyFileChanged(fileName: string, options: FSharpProjectOptions, userOpName: string) : NodeCode =
self.NotifyFileChanged(fileName, options, userOpName)
@@ -1678,3 +1746,11 @@ type internal BackgroundCompiler
userOpName: string
) : (FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option =
self.TryGetRecentCheckResultsForFile(fileName, options, sourceText, userOpName)
+
+ member _.TryGetRecentCheckResultsForFile
+ (
+ fileName: string,
+ projectSnapshot: FSharpProjectSnapshot,
+ userOpName: string
+ ) : (FSharpParseFileResults * FSharpCheckFileResults) option =
+ self.TryGetRecentCheckResultsForFile(fileName, projectSnapshot, userOpName)
diff --git a/src/Compiler/Service/BackgroundCompiler.fsi b/src/Compiler/Service/BackgroundCompiler.fsi
index f3bf3c96ccc..fff6324be35 100644
--- a/src/Compiler/Service/BackgroundCompiler.fsi
+++ b/src/Compiler/Service/BackgroundCompiler.fsi
@@ -102,6 +102,20 @@ type internal IBackgroundCompiler =
userOpName: string ->
Async
+ abstract GetProjectSnapshotFromScript:
+ fileName: string *
+ sourceText: ISourceTextNew *
+ previewEnabled: bool option *
+ loadedTimeStamp: System.DateTime option *
+ otherFlags: string array option *
+ useFsiAuxLib: bool option *
+ useSdkRefs: bool option *
+ sdkDirOverride: string option *
+ assumeDotNetFramework: bool option *
+ optionsStamp: int64 option *
+ userOpName: string ->
+ Async
+
abstract GetSemanticClassificationForFile:
fileName: string * snapshot: FSharpProjectSnapshot * userOpName: string ->
NodeCode
@@ -112,6 +126,8 @@ type internal IBackgroundCompiler =
abstract InvalidateConfiguration: options: FSharpProjectOptions * userOpName: string -> unit
+ abstract InvalidateConfiguration: projectSnapshot: FSharpProjectSnapshot * userOpName: string -> unit
+
abstract NotifyFileChanged: fileName: string * options: FSharpProjectOptions * userOpName: string -> NodeCode
abstract NotifyProjectCleaned: options: FSharpProjectOptions * userOpName: string -> Async
@@ -153,6 +169,10 @@ type internal IBackgroundCompiler =
fileName: string * options: FSharpProjectOptions * sourceText: ISourceText option * userOpName: string ->
(FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option
+ abstract TryGetRecentCheckResultsForFile:
+ fileName: string * projectSnapshot: FSharpProjectSnapshot * userOpName: string ->
+ (FSharpParseFileResults * FSharpCheckFileResults) option
+
abstract BeforeBackgroundFileCheck: IEvent
abstract FileChecked: IEvent
diff --git a/src/Compiler/Service/FSharpProjectSnapshot.fs b/src/Compiler/Service/FSharpProjectSnapshot.fs
index cdc7ffe9252..76d9705890e 100644
--- a/src/Compiler/Service/FSharpProjectSnapshot.fs
+++ b/src/Compiler/Service/FSharpProjectSnapshot.fs
@@ -123,7 +123,7 @@ type FSharpFileSnapshot(FileName: string, Version: string, GetSource: unit -> Ta
/// A source file snapshot with loaded source text.
type internal FSharpFileSnapshotWithSource
- (FileName: string, SourceHash: ImmutableArray, Source: ISourceText, IsLastCompiland: bool, IsExe: bool) =
+ (FileName: string, SourceHash: ImmutableArray, Source: ISourceTextNew, IsLastCompiland: bool, IsExe: bool) =
let version = lazy (SourceHash.ToBuilder().ToArray())
let stringVersion = lazy (version.Value |> BitConverter.ToString)
@@ -345,6 +345,12 @@ type internal ProjectSnapshotBase<'T when 'T :> IFileSnapshot>(projectCore: Proj
member this.FileKey(fileName: string) = this.UpTo(fileName).LastFileKey
member this.FileKey(index: FileIndex) = this.UpTo(index).LastFileKey
+ member this.FileKeyWithExtraFileSnapshotVersion(fileName: string) =
+ let fileKey = this.FileKey fileName
+ let fileSnapshot = this.SourceFiles |> Seq.find (fun f -> f.FileName = fileName)
+
+ fileKey.WithExtraVersion(fileSnapshot.Version |> Md5Hasher.toString)
+
/// Project snapshot with filenames and versions given as initial input
and internal ProjectSnapshot = ProjectSnapshotBase
@@ -394,10 +400,10 @@ and internal ProjectCore
let commandLineOptions =
lazy
(seq {
+ yield! OtherOptions
+
for r in ReferencesOnDisk do
$"-r:{r.Path}"
-
- yield! OtherOptions
}
|> Seq.toList)
@@ -527,6 +533,21 @@ and [] FSha
member _.Label = projectSnapshot.Label
member _.Identifier = FSharpProjectIdentifier projectSnapshot.ProjectCore.Identifier
+ member _.ProjectFileName = projectSnapshot.ProjectFileName
+ member _.ProjectId = projectSnapshot.ProjectId
+ member _.SourceFiles = projectSnapshot.SourceFiles
+ member _.ReferencesOnDisk = projectSnapshot.ReferencesOnDisk
+ member _.OtherOptions = projectSnapshot.OtherOptions
+ member _.ReferencedProjects = projectSnapshot.ReferencedProjects
+
+ member _.IsIncompleteTypeCheckEnvironment =
+ projectSnapshot.IsIncompleteTypeCheckEnvironment
+
+ member _.UseScriptResolutionRules = projectSnapshot.UseScriptResolutionRules
+ member _.LoadTime = projectSnapshot.LoadTime
+ member _.UnresolvedReferences = projectSnapshot.UnresolvedReferences
+ member _.OriginalLoadReferences = projectSnapshot.OriginalLoadReferences
+ member _.Stamp = projectSnapshot.Stamp
static member Create
(
diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs
index b117fef1bf6..c5ecfba812f 100644
--- a/src/Compiler/Service/TransparentCompiler.fs
+++ b/src/Compiler/Service/TransparentCompiler.fs
@@ -1,6 +1,7 @@
namespace FSharp.Compiler.CodeAnalysis.TransparentCompiler
open System
+open System.Linq
open System.Collections.Generic
open System.Runtime.CompilerServices
open System.Diagnostics
@@ -306,7 +307,7 @@ type internal CompilerCaches(sizeFactor: int) =
this.AssemblyData.Clear(shouldClear)
this.SemanticClassification.Clear(snd >> shouldClear)
this.ItemKeyStore.Clear(snd >> shouldClear)
- this.ScriptClosure.Clear(snd >> shouldClear) // Todo check if correct predicate
+ this.ScriptClosure.Clear(snd >> shouldClear)
type internal TransparentCompiler
(
@@ -377,26 +378,51 @@ type internal TransparentCompiler
let ComputeScriptClosure
(fileName: string)
- (source: ISourceText)
+ (source: ISourceTextNew)
(defaultFSharpBinariesDir: string)
(useSimpleResolution: bool)
(useFsiAuxLib: bool option)
(useSdkRefs: bool option)
(sdkDirOverride: string option)
(assumeDotNetFramework: bool option)
- (projectSnapshot: ProjectSnapshot)
+ (projectIdentifier: ProjectIdentifier)
+ (otherOptions: string list)
+ (stamp: int64 option)
=
+ let useFsiAuxLib = defaultArg useFsiAuxLib true
+ let useSdkRefs = defaultArg useSdkRefs true
+ let assumeDotNetFramework = defaultArg assumeDotNetFramework false
+
+ let key =
+ { new ICacheKey with
+ member _.GetKey() = fileName, projectIdentifier
+ member _.GetLabel() = $"ScriptClosure for %s{fileName}"
+
+ member _.GetVersion() =
+ Md5Hasher.empty
+ |> Md5Hasher.addStrings
+ [|
+ yield! otherOptions
+ match stamp with
+ | None -> ()
+ | Some stamp -> string stamp
+ |]
+ |> Md5Hasher.addBytes (source.GetChecksum().ToArray())
+ |> Md5Hasher.addBool useFsiAuxLib
+ |> Md5Hasher.addBool useFsiAuxLib
+ |> Md5Hasher.addBool useSdkRefs
+ |> Md5Hasher.addBool assumeDotNetFramework
+ |> Md5Hasher.toString
+ }
+
caches.ScriptClosure.Get(
- projectSnapshot.FileKey fileName,
+ key,
node {
- let useFsiAuxLib = defaultArg useFsiAuxLib true
- let useSdkRefs = defaultArg useSdkRefs true
let reduceMemoryUsage = ReduceMemoryFlag.Yes
- let assumeDotNetFramework = defaultArg assumeDotNetFramework false
let applyCompilerOptions tcConfig =
let fsiCompilerOptions = GetCoreFsiCompilerOptions tcConfig
- ParseCompilerOptions(ignore, fsiCompilerOptions, projectSnapshot.OtherOptions)
+ ParseCompilerOptions(ignore, fsiCompilerOptions, otherOptions)
let closure =
LoadClosure.ComputeClosureOfScriptText(
@@ -665,7 +691,9 @@ type internal TransparentCompiler
None
None
None
- projectSnapshot
+ projectSnapshot.Identifier
+ projectSnapshot.OtherOptions
+ projectSnapshot.Stamp
return (Some closure)
}
@@ -1444,9 +1472,8 @@ type internal TransparentCompiler
let ComputeParseAndCheckFileInProject (fileName: string) (projectSnapshot: ProjectSnapshot) =
caches.ParseAndCheckFileInProject.Get(
- projectSnapshot.FileKey fileName,
+ projectSnapshot.FileKeyWithExtraFileSnapshotVersion fileName,
node {
-
use _ =
Activity.start "ComputeParseAndCheckFileInProject" [| Activity.Tags.fileName, fileName |> Path.GetFileName |]
@@ -1521,7 +1548,9 @@ type internal TransparentCompiler
(Some tcConfig.useSdkRefs)
tcConfig.sdkDirOverride
(Some tcConfig.assumeDotNetFramework)
- projectSnapshot
+ projectSnapshot.Identifier
+ projectSnapshot.OtherOptions
+ projectSnapshot.Stamp
let typedResults =
FSharpCheckFileResults.Make(
@@ -1575,6 +1604,29 @@ type internal TransparentCompiler
}
)
+ let TryGetRecentCheckResultsForFile
+ (
+ fileName: string,
+ projectSnapshot: FSharpProjectSnapshot,
+ userOpName: string
+ ) : (FSharpParseFileResults * FSharpCheckFileResults) option =
+ ignore userOpName
+
+ let cacheKey =
+ projectSnapshot.ProjectSnapshot.FileKeyWithExtraFileSnapshotVersion fileName
+
+ let version = cacheKey.GetVersion()
+
+ let parseFileResultsAndcheckFileAnswer =
+ caches.ParseAndCheckFileInProject.TryGet(
+ cacheKey.GetKey(),
+ (fun (_fullVersion, fileContentVersion) -> fileContentVersion = (snd version))
+ )
+
+ match parseFileResultsAndcheckFileAnswer with
+ | Some(parseFileResults, FSharpCheckFileAnswer.Succeeded checkFileResults) -> Some(parseFileResults, checkFileResults)
+ | _ -> None
+
let ComputeProjectExtras (bootstrapInfo: BootstrapInfo) (projectSnapshot: ProjectSnapshotWithSources) =
caches.ProjectExtras.Get(
projectSnapshot.SignatureKey,
@@ -2111,6 +2163,125 @@ type internal TransparentCompiler
userOpName
)
+ member this.GetProjectSnapshotFromScript
+ (
+ fileName: string,
+ sourceText: ISourceTextNew,
+ previewEnabled: bool option,
+ loadedTimeStamp: DateTime option,
+ otherFlags: string array option,
+ useFsiAuxLib: bool option,
+ useSdkRefs: bool option,
+ sdkDirOverride: string option,
+ assumeDotNetFramework: bool option,
+ optionsStamp: int64 option,
+ userOpName: string
+ ) : Async =
+ use _ =
+ Activity.start
+ "BackgroundCompiler.GetProjectOptionsFromScript"
+ [| Activity.Tags.fileName, fileName; Activity.Tags.userOpName, userOpName |]
+
+ async {
+ // Use the same default as the background compiler.
+ let useFsiAuxLib = defaultArg useFsiAuxLib true
+ let useSdkRefs = defaultArg useSdkRefs true
+ let previewEnabled = defaultArg previewEnabled false
+
+ // Do we assume .NET Framework references for scripts?
+ let assumeDotNetFramework = defaultArg assumeDotNetFramework true
+
+ let extraFlags =
+ if previewEnabled then
+ [| "--langversion:preview" |]
+ else
+ [||]
+
+ let otherFlags = defaultArg otherFlags extraFlags
+ use diagnostics = new DiagnosticsScope(otherFlags |> Array.contains "--flaterrors")
+
+ let useSimpleResolution =
+ otherFlags |> Array.exists (fun x -> x = "--simpleresolution")
+
+ let loadedTimeStamp = defaultArg loadedTimeStamp DateTime.MaxValue // Not 'now', we don't want to force reloading
+ let projectFileName = fileName + ".fsproj"
+
+ let currentSourceFile =
+ FSharpFileSnapshot.Create(fileName, sourceText.GetHashCode().ToString(), (fun () -> Task.FromResult sourceText))
+
+ let! loadClosure =
+ ComputeScriptClosure
+ fileName
+ sourceText
+ FSharpCheckerResultsSettings.defaultFSharpBinariesDir
+ useSimpleResolution
+ (Some useFsiAuxLib)
+ (Some useSdkRefs)
+ sdkDirOverride
+ (Some assumeDotNetFramework)
+ (projectFileName, fileName)
+ (List.ofArray otherFlags)
+ optionsStamp
+ |> Async.AwaitNodeCode
+
+ let otherFlags =
+ [
+ yield "--noframework"
+ yield "--warn:3"
+ yield! otherFlags
+ for code, _ in loadClosure.NoWarns do
+ yield "--nowarn:" + code
+ ]
+
+ let sourceFiles =
+ loadClosure.SourceFiles
+ |> List.map (fun (sf, _) ->
+ if sf = fileName then
+ currentSourceFile
+ else
+ FSharpFileSnapshot.CreateFromFileSystem sf)
+
+ let references =
+ loadClosure.References
+ |> List.map (fun (r, _) ->
+ let lastModified = FileSystem.GetLastWriteTimeShim r
+
+ {
+ Path = r
+ LastModified = lastModified
+ })
+
+ let snapshot =
+ FSharpProjectSnapshot.Create(
+ fileName + ".fsproj",
+ None,
+ sourceFiles,
+ references,
+ otherFlags,
+ List.empty,
+ false,
+ true,
+ loadedTimeStamp,
+ Some(FSharpUnresolvedReferencesSet(loadClosure.UnresolvedReferences)),
+ loadClosure.OriginalLoadReferences,
+ optionsStamp
+ )
+
+ let diags =
+ loadClosure.LoadClosureRootFileDiagnostics
+ |> List.map (fun (exn, isError) ->
+ FSharpDiagnostic.CreateFromException(
+ exn,
+ isError,
+ range.Zero,
+ false,
+ otherFlags |> List.contains "--flaterrors",
+ None
+ ))
+
+ return snapshot, (diags @ diagnostics.Diagnostics)
+ }
+
member this.GetSemanticClassificationForFile(fileName: string, snapshot: FSharpProjectSnapshot, userOpName: string) =
node {
ignore userOpName
@@ -2136,6 +2307,12 @@ type internal TransparentCompiler
member this.InvalidateConfiguration(options: FSharpProjectOptions, userOpName: string) : unit =
backgroundCompiler.InvalidateConfiguration(options, userOpName)
+ member this.InvalidateConfiguration(projectSnapshot: FSharpProjectSnapshot, _userOpName: string) : unit =
+ let (FSharpProjectIdentifier(projectFileName, outputFileName)) =
+ projectSnapshot.Identifier
+
+ this.Caches.Clear(Set.singleton (ProjectIdentifier(projectFileName, outputFileName)))
+
member this.NotifyFileChanged(fileName: string, options: FSharpProjectOptions, userOpName: string) : NodeCode =
backgroundCompiler.NotifyFileChanged(fileName, options, userOpName)
@@ -2201,3 +2378,11 @@ type internal TransparentCompiler
userOpName: string
) : (FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option =
backgroundCompiler.TryGetRecentCheckResultsForFile(fileName, options, sourceText, userOpName)
+
+ member this.TryGetRecentCheckResultsForFile
+ (
+ fileName: string,
+ projectSnapshot: FSharpProjectSnapshot,
+ userOpName: string
+ ) : (FSharpParseFileResults * FSharpCheckFileResults) option =
+ TryGetRecentCheckResultsForFile(fileName, projectSnapshot, userOpName)
diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi
index 9aa5929566c..8e581872d84 100644
--- a/src/Compiler/Service/TransparentCompiler.fsi
+++ b/src/Compiler/Service/TransparentCompiler.fsi
@@ -118,7 +118,7 @@ type internal CompilerCaches =
member ParseAndCheckAllFilesInProject: AsyncMemoizeDisabled
member ParseAndCheckFileInProject:
- AsyncMemoize<(string * (string * string)), string, (FSharpParseFileResults * FSharpCheckFileAnswer)>
+ AsyncMemoize<(string * (string * string)), string * string, (FSharpParseFileResults * FSharpCheckFileAnswer)>
member ParseAndCheckProject: AsyncMemoize<(string * string), string, FSharpCheckProjectResults>
diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs
index 803755ab13f..103c84e63cf 100644
--- a/src/Compiler/Service/service.fs
+++ b/src/Compiler/Service/service.fs
@@ -338,6 +338,10 @@ type FSharpChecker
let userOpName = defaultArg userOpName "Unknown"
backgroundCompiler.TryGetRecentCheckResultsForFile(fileName, options, sourceText, userOpName)
+ member _.TryGetRecentCheckResultsForFile(fileName: string, projectSnapshot: FSharpProjectSnapshot, ?userOpName: string) =
+ let userOpName = defaultArg userOpName "Unknown"
+ backgroundCompiler.TryGetRecentCheckResultsForFile(fileName, projectSnapshot, userOpName)
+
member _.Compile(argv: string[], ?userOpName: string) =
let _userOpName = defaultArg userOpName "Unknown"
use _ = Activity.start "FSharpChecker.Compile" [| Activity.Tags.userOpName, _userOpName |]
@@ -372,6 +376,10 @@ type FSharpChecker
let userOpName = defaultArg userOpName "Unknown"
backgroundCompiler.InvalidateConfiguration(options, userOpName)
+ member _.InvalidateConfiguration(projectSnapshot: FSharpProjectSnapshot, ?userOpName: string) =
+ let userOpName = defaultArg userOpName "Unknown"
+ backgroundCompiler.InvalidateConfiguration(projectSnapshot, userOpName)
+
/// Clear the internal cache of the given projects.
member _.ClearCache(options: seq, ?userOpName: string) =
let userOpName = defaultArg userOpName "Unknown"
@@ -553,6 +561,37 @@ type FSharpChecker
userOpName
)
+ /// For a given script file, get the ProjectSnapshot implied by the #load closure
+ member _.GetProjectSnapshotFromScript
+ (
+ fileName,
+ source,
+ ?previewEnabled,
+ ?loadedTimeStamp,
+ ?otherFlags,
+ ?useFsiAuxLib,
+ ?useSdkRefs,
+ ?assumeDotNetFramework,
+ ?sdkDirOverride,
+ ?optionsStamp: int64,
+ ?userOpName: string
+ ) =
+ let userOpName = defaultArg userOpName "Unknown"
+
+ backgroundCompiler.GetProjectSnapshotFromScript(
+ fileName,
+ source,
+ previewEnabled,
+ loadedTimeStamp,
+ otherFlags,
+ useFsiAuxLib,
+ useSdkRefs,
+ sdkDirOverride,
+ assumeDotNetFramework,
+ optionsStamp,
+ userOpName
+ )
+
member _.GetProjectOptionsFromCommandLineArgs(projectFileName, argv, ?loadedTimeStamp, ?isInteractive, ?isEditing) =
let isEditing = defaultArg isEditing false
let isInteractive = defaultArg isInteractive false
diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi
index e74249cd604..71e0f51df3d 100644
--- a/src/Compiler/Service/service.fsi
+++ b/src/Compiler/Service/service.fsi
@@ -60,7 +60,8 @@ type public FSharpChecker =
bool ->
FSharpChecker
- member internal UsesTransparentCompiler: bool
+ []
+ member UsesTransparentCompiler: bool
///
/// Parse a source code file, returning information about brace matching in the file.
@@ -250,6 +251,34 @@ type public FSharpChecker =
?userOpName: string ->
Async
+ /// Used to differentiate between scripts, to consider each script a separate project. Also used in formatted error messages.
+ /// The source for the file.
+ /// Is the preview compiler enabled.
+ /// Indicates when the script was loaded into the editing environment,
+ /// so that an 'unload' and 'reload' action will cause the script to be considered as a new project,
+ /// so that references are re-resolved.
+ /// Other flags for compilation.
+ /// Add a default reference to the FSharp.Compiler.Interactive.Settings library.
+ /// Use the implicit references from the .NET SDK.
+ /// Set up compilation and analysis for .NET Framework scripts.
+ /// Override the .NET SDK used for default references.
+ /// An optional unique stamp for the options.
+ /// An optional string used for tracing compiler operations associated with this request.
+ []
+ member GetProjectSnapshotFromScript:
+ fileName: string *
+ source: ISourceTextNew *
+ ?previewEnabled: bool *
+ ?loadedTimeStamp: DateTime *
+ ?otherFlags: string[] *
+ ?useFsiAuxLib: bool *
+ ?useSdkRefs: bool *
+ ?assumeDotNetFramework: bool *
+ ?sdkDirOverride: string *
+ ?optionsStamp: int64 *
+ ?userOpName: string ->
+ Async
+
/// Get the FSharpProjectOptions implied by a set of command line arguments.
///
/// Used to differentiate between projects and for the base directory of the project.
@@ -393,6 +422,11 @@ type public FSharpChecker =
fileName: string * options: FSharpProjectOptions * ?sourceText: ISourceText * ?userOpName: string ->
(FSharpParseFileResults * FSharpCheckFileResults (* hash *) * int64) option
+ []
+ member TryGetRecentCheckResultsForFile:
+ fileName: string * projectSnapshot: FSharpProjectSnapshot * ?userOpName: string ->
+ (FSharpParseFileResults * FSharpCheckFileResults) option
+
/// This function is called when the entire environment is known to have changed for reasons not encoded in the ProjectOptions of any project/compilation.
member InvalidateAll: unit -> unit
@@ -404,6 +438,13 @@ type public FSharpChecker =
/// An optional string used for tracing compiler operations associated with this request.
member InvalidateConfiguration: options: FSharpProjectOptions * ?userOpName: string -> unit
+ ///
+ /// This function is called when the configuration is known to have changed for reasons not encoded in the projectSnapshot.
+ /// For example, dependent references may have been deleted or created.
+ ///
+ []
+ member InvalidateConfiguration: projectSnapshot: FSharpProjectSnapshot * ?userOpName: string -> unit
+
/// Clear the internal cache of the given projects.
/// The given project options.
/// An optional string used for tracing compiler operations associated with this request.
diff --git a/src/Compiler/Utilities/LruCache.fs b/src/Compiler/Utilities/LruCache.fs
index c75ed1d88cf..7b06292c2e2 100644
--- a/src/Compiler/Utilities/LruCache.fs
+++ b/src/Compiler/Utilities/LruCache.fs
@@ -198,21 +198,27 @@ type internal LruCache<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVers
/// Returns an option of a value for given key and version, and also a list of all other versions for given key
member this.GetAll(key, version) =
- this.TryGet(key, version),
+ let others =
+ this.GetAll(key) |> Seq.filter (fun (ver, _val) -> ver <> version) |> Seq.toList
+ this.TryGet(key, version), others
+
+ /// Returns a list of version * value pairs for a given key. The strongly held value is first in the list.
+ member _.GetAll(key: 'TKey) : ('TVersion * 'TValue) seq =
match dictionary.TryGetValue key with
| false, _ -> []
| true, versionDict ->
versionDict.Values
- |> Seq.map (fun node -> node.Value)
- |> Seq.filter (p24 >> ((<>) version))
+ |> Seq.map (_.Value)
+ |> Seq.sortBy (function
+ | _, _, _, Strong _ -> 0
+ | _ -> 1)
|> Seq.choose (function
| _, ver, _, Strong v -> Some(ver, v)
| _, ver, _, Weak r ->
match r.TryGetTarget() with
| true, x -> Some(ver, x)
| _ -> None)
- |> Seq.toList
member _.Remove(key, version) =
match dictionary.TryGetValue key with
diff --git a/src/Compiler/Utilities/LruCache.fsi b/src/Compiler/Utilities/LruCache.fsi
index d9aefd2a240..eb2880047d7 100644
--- a/src/Compiler/Utilities/LruCache.fsi
+++ b/src/Compiler/Utilities/LruCache.fsi
@@ -33,6 +33,9 @@ type internal LruCache<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVers
/// Returns an option of a value for given key and version, and also a list of all other versions for given key
member GetAll: key: 'TKey * version: 'TVersion -> 'TValue option * ('TVersion * 'TValue) list
+ /// Returns a list of version * value pairs for a given key. The strongly held value is first in the list.
+ member GetAll: key: 'TKey -> ('TVersion * 'TValue) seq
+
member GetValues: unit -> (string * 'TVersion * 'TValue) seq
member Remove: key: 'TKey -> unit
diff --git a/src/Compiler/Utilities/ReadOnlySpan.fs b/src/Compiler/Utilities/ReadOnlySpan.fs
index 05683eadb9e..a01439bee63 100644
--- a/src/Compiler/Utilities/ReadOnlySpan.fs
+++ b/src/Compiler/Utilities/ReadOnlySpan.fs
@@ -59,4 +59,16 @@ type ReadOnlySpanExtensions =
i <- i - 1
if found then i else -1
+
+ []
+ static member LastIndexOfAnyExcept(span: ReadOnlySpan, value: char) =
+ let mutable i = span.Length - 1
+ let mutable found = false
+
+ while not found && i >= 0 do
+ let c = span[i]
+
+ if c <> value then found <- true else i <- i - 1
+
+ if found then i else -1
#endif
diff --git a/src/Compiler/Utilities/ReadOnlySpan.fsi b/src/Compiler/Utilities/ReadOnlySpan.fsi
index 67591a03f88..b772ab58642 100644
--- a/src/Compiler/Utilities/ReadOnlySpan.fsi
+++ b/src/Compiler/Utilities/ReadOnlySpan.fsi
@@ -17,4 +17,7 @@ type internal ReadOnlySpanExtensions =
[]
static member LastIndexOfAnyInRange: span: ReadOnlySpan * lowInclusive: char * highInclusive: char -> int
+
+ []
+ static member LastIndexOfAnyExcept: span: ReadOnlySpan * value: char -> int
#endif
diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy
index 6c5415667d0..4080fc7ec8b 100644
--- a/src/Compiler/pars.fsy
+++ b/src/Compiler/pars.fsy
@@ -6776,8 +6776,8 @@ interpolatedStringParts:
| INTERP_STRING_END
{ [ SynInterpolatedStringPart.String(fst $1, rhs parseState 1) ] }
- | INTERP_STRING_PART interpolatedStringFill interpolatedStringParts
- { SynInterpolatedStringPart.String(fst $1, rhs parseState 1) :: SynInterpolatedStringPart.FillExpr $2 :: $3 }
+ | INTERP_STRING_PART interpolatedStringFill interpolatedStringParts
+ { SynInterpolatedStringPart.String(fst $1, rhs parseState 1) :: SynInterpolatedStringPart.FillExpr $2 :: $3 }
| INTERP_STRING_PART interpolatedStringParts
{ let rbrace = parseState.InputEndPosition 1
diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf
index c7dbc64bac7..d4142d783fa 100644
--- a/src/Compiler/xlf/FSComp.txt.cs.xlf
+++ b/src/Compiler/xlf/FSComp.txt.cs.xlf
@@ -292,6 +292,11 @@
literál float32 bez tečky
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Vyvolá chyby pro přepsání jiných než virtuálních členů
@@ -372,6 +377,11 @@
rozhraní s vícenásobným obecným vytvářením instancí
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
Povolit duplikát malými písmeny při atributu RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf
index d5800420f00..fa0904ef50f 100644
--- a/src/Compiler/xlf/FSComp.txt.de.xlf
+++ b/src/Compiler/xlf/FSComp.txt.de.xlf
@@ -292,6 +292,11 @@
punktloses float32-Literal
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Löst Fehler für Außerkraftsetzungen nicht virtueller Member aus.
@@ -372,6 +377,11 @@
Schnittstellen mit mehrfacher generischer Instanziierung
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
DU in Kleinbuchstaben zulassen, wenn requireQualifiedAccess-Attribut
diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf
index dcfce175697..2d5ada63574 100644
--- a/src/Compiler/xlf/FSComp.txt.es.xlf
+++ b/src/Compiler/xlf/FSComp.txt.es.xlf
@@ -292,6 +292,11 @@
literal float32 sin punto
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Genera errores para invalidaciones de miembros no virtuales
@@ -372,6 +377,11 @@
interfaces con creación de instancias genéricas múltiples
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
Permitir DU en minúsculas con el atributo RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf
index 590c4fb8e15..da3c6f4b9b6 100644
--- a/src/Compiler/xlf/FSComp.txt.fr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.fr.xlf
@@ -292,6 +292,11 @@
littéral float32 sans point
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Déclenche des erreurs pour les remplacements de membres non virtuels
@@ -372,6 +377,11 @@
interfaces avec plusieurs instanciations génériques
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
Autoriser les DU en minuscules pour l'attribut RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf
index 70613984b76..010e34a81a2 100644
--- a/src/Compiler/xlf/FSComp.txt.it.xlf
+++ b/src/Compiler/xlf/FSComp.txt.it.xlf
@@ -292,6 +292,11 @@
valore letterale float32 senza punti
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Genera errori per gli override dei membri non virtuali
@@ -372,6 +377,11 @@
interfacce con più creazioni di istanze generiche
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
Consentire l’unione discriminata minuscola quando l'attributo RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf
index 84a9ca6ef70..8a92ac2ea9e 100644
--- a/src/Compiler/xlf/FSComp.txt.ja.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ja.xlf
@@ -292,6 +292,11 @@
ドットなしの float32 リテラル
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
仮想メンバー以外のオーバーライドに対してエラーを発生させます
@@ -372,6 +377,11 @@
複数のジェネリックのインスタンス化を含むインターフェイス
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
RequireQualifiedAccess 属性の場合に小文字 DU を許可する
diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf
index 38ffac7d32d..51778bd4145 100644
--- a/src/Compiler/xlf/FSComp.txt.ko.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ko.xlf
@@ -292,6 +292,11 @@
점이 없는 float32 리터럴
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
비가상 멤버 재정의에 대한 오류 발생
@@ -372,6 +377,11 @@
여러 제네릭 인스턴스화가 포함된 인터페이스
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
RequireQualifiedAccess 특성이 있는 경우 소문자 DU 허용
diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf
index ac1d54f63c4..a8a3f05ba9a 100644
--- a/src/Compiler/xlf/FSComp.txt.pl.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pl.xlf
@@ -292,6 +292,11 @@
bezkropkowy literał float32
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Zgłasza błędy w przypadku przesłonięć elementów innych niż wirtualne
@@ -372,6 +377,11 @@
interfejsy z wieloma ogólnymi wystąpieniami
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
Zezwalaj na małą literę DU, gdy występuje RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
index 6beb1946267..1f62f9a3d04 100644
--- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
@@ -292,6 +292,11 @@
literal float32 sem ponto
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Gera erros para substituições de membros não virtuais
@@ -372,6 +377,11 @@
interfaces com várias instanciações genéricas
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
Permitir DU em minúsculas quando o atributo RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf
index 1b83dc7cc6b..64ce92b6125 100644
--- a/src/Compiler/xlf/FSComp.txt.ru.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ru.xlf
@@ -292,6 +292,11 @@
литерал float32 без точки
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Вызывает ошибки при переопределениях невиртуальных элементов
@@ -372,6 +377,11 @@
интерфейсы с множественным универсальным созданием экземпляра
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
Разрешить du в нижнем регистре, если атрибут RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf
index 43f5069b2eb..d77dfd672ec 100644
--- a/src/Compiler/xlf/FSComp.txt.tr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.tr.xlf
@@ -292,6 +292,11 @@
noktasız float32 sabit değeri
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
Sanal olmayan üyelerde geçersiz kılmalar için hatalar oluştur
@@ -372,6 +377,11 @@
birden çok genel örnek oluşturma içeren arabirimler
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
RequireQualifiedAccess özniteliğinde küçük harf DU'ya izin ver
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
index 91cad01e99e..5393d25202a 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
@@ -292,6 +292,11 @@
无点 float32 文本
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
引发非虚拟成员替代的错误
@@ -372,6 +377,11 @@
具有多个泛型实例化的接口
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
当 RequireQualifiedAccess 属性时允许小写 DU
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
index f12b3fd0b5e..f75fc155fde 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
@@ -292,6 +292,11 @@
無點號的 float32 常值
+
+ Enforce AttributeTargets on functions
+ Enforce AttributeTargets on functions
+
+
Raises errors for non-virtual members overrides
引發非虛擬成員覆寫的錯誤
@@ -372,6 +377,11 @@
具有多個泛型具現化的介面
+
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+ Optimizes interpolated strings in certain cases, by lowering to concatenation
+
+
Allow lowercase DU when RequireQualifiedAccess attribute
RequireQualifiedAccess 屬性時允許小寫 DU
diff --git a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj
index a427f7006dd..7c186a76bb4 100644
--- a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj
+++ b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj
@@ -3,7 +3,7 @@
true
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
Microsoft.FSharp.Compiler.nuspec
true
.NET Core compatible version of the F# compiler fsc.exe.
@@ -24,6 +24,7 @@
+
diff --git a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec
index ca36309d5da..24df391b69f 100644
--- a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec
+++ b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec
@@ -4,7 +4,7 @@
$CommonMetadataElements$
en-US
-
+
@@ -26,16 +26,16 @@
this approach gives a very small deployment. Which is kind of necessary.
-->
-
-
-
-
-
-
+
+
+
+
+
+
+ target="lib\$fSharpNetCoreProductTargetFramework$" />
+ target="lib\$fSharpNetCoreProductTargetFramework$" />
@@ -45,14 +45,14 @@
-
+
+ target="lib\$fSharpNetCoreProductTargetFramework$" />
-
+ target="lib\$fSharpNetCoreProductTargetFramework$" />
+
+ target="lib\$fSharpNetCoreProductTargetFramework$" />
diff --git a/src/fsc/fscProject/fsc.fsproj b/src/fsc/fscProject/fsc.fsproj
index 64c4651a7f4..b382709200d 100644
--- a/src/fsc/fscProject/fsc.fsproj
+++ b/src/fsc/fscProject/fsc.fsproj
@@ -3,15 +3,15 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
x86
Debug;Release;Proto;ReleaseCompressed
net472
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
x86
diff --git a/src/fsi/fsiProject/fsi.fsproj b/src/fsi/fsiProject/fsi.fsproj
index dd17f8bd53d..653122fc76d 100644
--- a/src/fsi/fsiProject/fsi.fsproj
+++ b/src/fsi/fsiProject/fsi.fsproj
@@ -3,15 +3,15 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
x86
Debug;Release;Proto;ReleaseCompressed
net472
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
x86
diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1
index 4b9dcaebf16..8528710b76f 100644
--- a/tests/AheadOfTime/Trimming/check.ps1
+++ b/tests/AheadOfTime/Trimming/check.ps1
@@ -42,4 +42,4 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) {
CheckTrim -root "SelfContained_Trimming_Test" -tfm "net8.0" -outputfile "FSharp.Core.dll" -expected_len 287232
# Check net7.0 trimmed assemblies
-CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net8.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 8821248
+CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net8.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 8820736
diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj
index b05e1882f6e..ba15e56c359 100644
--- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj
+++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj
@@ -2,7 +2,7 @@
Library
- net8.0;net472
+ $(FSharpNetCoreProductTargetFramework);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 5da0cbb3bfb..da2c065fe49 100644
--- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj
+++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj
@@ -2,7 +2,7 @@
Library
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
$(TestTargetFramework)
false
NO_GENERATIVE
diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj
index 96006f06673..4a8d1df2302 100644
--- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj
+++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj
@@ -2,7 +2,7 @@
Library
- net8.0;net472
+ $(FSharpNetCoreProductTargetFramework);net472
typeproviders
$(FSharpCoreShippedPackageVersionValue)
typeproviders
diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
index e3c796d0bdd..0a2421f3262 100644
--- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
+++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
@@ -3,8 +3,8 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
Library
true
xunit
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs
index cddee9f80ab..c7861ee3e56 100644
--- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs
@@ -94,6 +94,147 @@ module CustomAttributes_AttributeUsage =
(Error 842, Line 24, Col 7, Line 24, Col 36, "This attribute is not valid for use on this language element")
(Error 842, Line 29, Col 15, Line 29, Col 47, "This attribute is not valid for use on this language element")
]
+
+ // SOURCE=E_AttributeTargetIsField01.fs # E_AttributeTargetIsField01.fs
+ []
+ let ``E_AttributeTargetIsField01_fs`` compilation =
+ compilation
+ |> withLangVersion80
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldSucceed
+
+ // SOURCE=E_AttributeTargetIsField01.fs # E_AttributeTargetIsField01.fs
+ []
+ let ``E_AttributeTargetIsField01_fs preview`` compilation =
+ compilation
+ |> withLangVersionPreview
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 842, Line 9, Col 3, Line 9, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 12, Col 3, Line 12, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 15, Col 3, Line 15, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 18, Col 3, Line 18, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 21, Col 3, Line 21, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 24, Col 3, Line 24, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 27, Col 3, Line 27, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 30, Col 3, Line 30, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 33, Col 3, Line 33, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 36, Col 3, Line 36, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 39, Col 3, Line 39, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 42, Col 3, Line 42, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 45, Col 3, Line 45, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 49, Col 3, Line 49, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 56, Col 3, Line 56, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 64, Col 3, Line 64, Col 12, "This attribute is not valid for use on this language element")
+ (Error 842, Line 66, Col 7, Line 66, Col 16, "This attribute is not valid for use on this language element")
+ ]
+
+ // SOURCE=E_AttributeTargetIsField02.fs # E_AttributeTargetIsField02.fs
+ []
+ let ``E_AttributeTargetIsField02_fs`` compilation =
+ compilation
+ |> withLangVersion80
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldSucceed
+
+ // SOURCE=E_AttributeTargetIsField02.fs # E_AttributeTargetIsField02.fs
+ []
+ let ``E_AttributeTargetIsField02_fs preview`` compilation =
+ compilation
+ |> withLangVersionPreview
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 842, Line 11, Col 6, Line 11, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 14, Col 6, Line 14, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 17, Col 6, Line 17, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 19, Col 10, Line 19, Col 19, "This attribute is not valid for use on this language element")
+ (Error 842, Line 21, Col 6, Line 21, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 24, Col 6, Line 24, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 27, Col 6, Line 27, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 30, Col 6, Line 30, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 33, Col 6, Line 33, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 36, Col 6, Line 36, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 39, Col 6, Line 39, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 42, Col 6, Line 42, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 45, Col 6, Line 45, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 49, Col 6, Line 49, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 56, Col 6, Line 56, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 64, Col 6, Line 64, Col 15, "This attribute is not valid for use on this language element")
+ (Error 842, Line 66, Col 10, Line 66, Col 19, "This attribute is not valid for use on this language element")
+ (Error 842, Line 68, Col 6, Line 68, Col 15, "This attribute is not valid for use on this language element")
+ ]
+
+ // SOURCE=E_AttributeTargetIsMethod02.fs # E_AttributeTargetIsMethod02.fs
+ []
+ let ``E_AttributeTargetIsMethod02_fs`` compilation =
+ compilation
+ |> withLangVersion80
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldSucceed
+
+ // SOURCE=E_AttributeTargetIsMethod02.fs # E_AttributeTargetIsMethod02.fs
+ []
+ let ``E_AttributeTargetIsMethod02_fs preview`` compilation =
+ compilation
+ |> withLangVersionPreview
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 842, Line 9, Col 3, Line 9, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 12, Col 3, Line 12, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 15, Col 3, Line 15, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 18, Col 3, Line 18, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 21, Col 3, Line 21, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 24, Col 3, Line 24, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 26, Col 7, Line 26, Col 17, "This attribute is not valid for use on this language element")
+ (Error 842, Line 28, Col 3, Line 28, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 31, Col 3, Line 31, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 34, Col 3, Line 34, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 39, Col 3, Line 39, Col 13, "This attribute is not valid for use on this language element")
+ ]
+
+ // SOURCE=E_AttributeTargetIsMethod03.fs # E_AttributeTargetIsMethod03.fs
+ []
+ let ``E_AttributeTargetIsMethod03_fs`` compilation =
+ compilation
+ |> withLangVersion80
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldSucceed
+
+ // SOURCE=E_AttributeTargetIsMethod03.fs # E_AttributeTargetIsMethod03.fs
+ []
+ let ``E_AttributeTargetIsMethod03_fs preview`` compilation =
+ compilation
+ |> withLangVersionPreview
+ |> withOptions ["--nowarn:25"]
+ |> verifyCompile
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 842, Line 12, Col 6, Line 12, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 15, Col 6, Line 15, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 18, Col 6, Line 18, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 20, Col 10, Line 20, Col 20, "This attribute is not valid for use on this language element")
+ (Error 842, Line 22, Col 6, Line 22, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 25, Col 6, Line 25, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 28, Col 6, Line 28, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 31, Col 6, Line 31, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 34, Col 6, Line 34, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 37, Col 6, Line 37, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 39, Col 10, Line 39, Col 20, "This attribute is not valid for use on this language element")
+ (Error 842, Line 41, Col 6, Line 41, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 44, Col 6, Line 44, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 47, Col 6, Line 47, Col 16, "This attribute is not valid for use on this language element")
+ (Error 842, Line 52, Col 6, Line 52, Col 16, "This attribute is not valid for use on this language element")
+ ]
// SOURCE=E_ConditionalAttribute.fs SCFLAGS="--test:ErrorRanges" # E_ConditionalAttribute.fs
[]
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsField01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsField01.fs
new file mode 100644
index 00000000000..1e3e48516c9
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsField01.fs
@@ -0,0 +1,67 @@
+// This tests that AttributeTargets.Field is not allowed in let function bindings
+
+open System
+
+[]
+type FieldOnlyAttribute() =
+ inherit Attribute()
+
+[] // Should fail
+let func1 () = "someFunction"
+
+[] // Should fail
+let func2 a = a + 1
+
+[] // Should fail
+let func3 (a, b) = a + b
+
+[] // Should fail
+let func4 (a: int) : int = a + 1
+
+[] // Should fail
+let func5 a b = [ a; b ]
+
+[] // Should fail
+let func6<'a> = "someTypedFunction"
+
+[] // Should fail
+let func7<'a> (x : 'a) = "someTypedFunction2"
+
+[] // Should fail
+let func8 = fun x -> x
+
+[] // Should fail
+let func9 = id
+
+[] // Should fail
+let __func10<'a> = false
+
+[] // Should fail
+let __func11<'a> : bool = false
+
+[] // Should fail
+let (|Bool|_|) = function "true" -> Some true | "false" -> Some false | _ -> None
+
+[] // Should fail
+[]
+let (|BoolExpr2|_|) = function "true" -> ValueSome true | "false" -> ValueSome false | _ -> ValueNone
+
+[] // Should fail
+let (|BoolExpr3|_|) x =
+ match x with
+ | "true" -> Some true
+ | "false" -> Some false
+ | _ -> None
+
+[] // Should fail
+[]
+let (|BoolExpr4|_|) x =
+ match x with
+ | "true" -> ValueSome true
+ | "false" -> ValueSome false
+ | _ -> ValueNone
+
+[] // Should fail
+let rec func12() = 0
+and [] func13() = [] // Should fail
+
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsField02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsField02.fs
new file mode 100644
index 00000000000..c7ba6dda24f
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsField02.fs
@@ -0,0 +1,69 @@
+// This tests that AttributeTargets.Field is not allowed in class let function bindings
+
+open System
+open System.Diagnostics
+
+[]
+type FieldOnlyAttribute() =
+ inherit Attribute()
+
+type TestClass() =
+ [] // Should fail
+ static let func1() = "someFunction"
+
+ [] // Should fail
+ static let rec func2() = "someFunction"
+
+ []// Should fail
+ static let rec func3() = "someFunction"
+ and [] fun4() = "someFunction" // Should fail
+
+ [] // Should fail
+ let func5 () = "someFunction"
+
+ [] // Should fail
+ let func6 a = a + 1
+
+ [] // Should fail
+ let func7 (a, b) = a + b
+
+ [] // Should fail
+ let func8 (a: int) : int = a + 1
+
+ [] // Should fail
+ let func9 a b = [ a; b ]
+
+ [] // Should fail
+ let func10 = fun x -> x
+
+ [] // Should fail
+ let func11 = id
+
+ [] // Should fail
+ let (|Bool|_|) = function "true" -> Some true | "false" -> Some false | _ -> None
+
+ [] // Should fail
+ []
+ let (|BoolExpr2|_|) = function "true" -> ValueSome true | "false" -> ValueSome false | _ -> ValueNone
+
+ [] // Should fail
+ let (|BoolExpr3|_|) x =
+ match x with
+ | "true" -> Some true
+ | "false" -> Some false
+ | _ -> None
+
+ [] // Should fail
+ []
+ let (|BoolExpr4|_|) x =
+ match x with
+ | "true" -> ValueSome true
+ | "false" -> ValueSome false
+ | _ -> ValueNone
+
+ [] // Should fail
+ let rec func12() = 0
+ and [] func13() = [] // Should fail
+
+ [] // Should fail
+ let rec func14() = 0
\ No newline at end of file
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod02.fs
new file mode 100644
index 00000000000..8687a9b1d0c
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod02.fs
@@ -0,0 +1,40 @@
+// This tests that AttributeTargets.Method is not allowed in let bound values
+
+open System
+
+[]
+type MethodOnlyAttribute() =
+ inherit Attribute()
+
+[] // Should fail
+let val1 = "someValue"
+
+[] // Should fail
+let i, j, k = (1, 2, 3)
+
+[] // Should fail
+let val2 = nameof(MethodOnlyAttribute)
+
+[] // Should fail
+let rec val3 = nameof(val2)
+
+[] // Should fail
+let ``val4`` = "someValue"
+
+[] // Should fail
+let rec val5 = 0
+and [] val6 = [] // Should fail
+
+[] // Should fail
+let (a :: _) = []
+
+[] // Should fail
+let (d, e) as val7 = 1, 2
+
+[] // Should fail
+let 1 = 0
+
+type X = { X: int }
+
+[] // Should fail
+let { X = _ } = { X = 1 }
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod03.fs
new file mode 100644
index 00000000000..c60ecae32b2
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod03.fs
@@ -0,0 +1,54 @@
+// This tests that AttributeTargets.Method is not allowed in class let bound values
+
+open System
+open System.Diagnostics
+
+[]
+type MethodOnlyAttribute() =
+ inherit Attribute()
+
+type TestClass() =
+
+ [] // Should fail
+ static let val1 = "someValue"
+
+ [] // Should fail
+ static let rec val2 = "someValue"
+
+ [] // Should fail
+ static let rec val3 = "someValue"
+ and [] val4 = "someValue" // Should fail
+
+ [] // Should fail
+ let val5 = "someValue"
+
+ [] // Should fail
+ let i, j, k = (1, 2, 3)
+
+ [] // Should fail
+ let val5 = nameof(MethodOnlyAttribute)
+
+ [] // Should fail
+ let rec val6 = nameof(val5)
+
+ [] // Should fail
+ let ``val7`` = "someValue"
+
+ [] // Should fail
+ let rec val8 = 0
+ and [] val9 = [] // Should fail
+
+ [] // Should fail
+ let (a :: _) = []
+
+ [] // Should fail
+ let (d, e) as foo = 1, 2
+
+ [] // Should fail
+ let 1 = 0
+
+ type X = { X: int }
+
+ [] // Should fail
+ let { X = _ } = { X = 1 }
+
diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StringFormatAndInterpolation.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StringFormatAndInterpolation.fs
index 0ef7d23422e..3038460f577 100644
--- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StringFormatAndInterpolation.fs
+++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StringFormatAndInterpolation.fs
@@ -5,8 +5,8 @@ namespace EmittedIL
open Xunit
open FSharp.Test.Compiler
-#if !DEBUG // sensitive to debug-level code coming across from debug FSharp.Core
module ``StringFormatAndInterpolation`` =
+#if !DEBUG // sensitive to debug-level code coming across from debug FSharp.Core
[]
let ``Interpolated string with no holes is reduced to a string or simple format when used in printf``() =
FSharp """
@@ -34,3 +34,61 @@ IL_0017: ret"""]
#endif
+ []
+ let ``Interpolated string with 2 parts consisting only of strings is lowered to concat`` () =
+ FSharp $"""
+module StringFormatAndInterpolation
+
+let f (s: string) = $"ab{{s}}"
+ """
+ |> withLangVersionPreview
+ |> compile
+ |> shouldSucceed
+ |> verifyIL ["""
+IL_0000: ldstr "ab"
+IL_0005: ldarg.0
+IL_0006: call string [runtime]System.String::Concat(string,
+ string)
+IL_000b: ret"""]
+
+ []
+ let ``Interpolated string with 3 parts consisting only of strings is lowered to concat`` () =
+ //let str = "$\"\"\"ab{\"c\"}d\"\"\""
+ FSharp $"""
+module StringFormatAndInterpolation
+
+let c = "c"
+let str = $"ab{{c}}d"
+ """
+ |> withLangVersionPreview
+ |> compile
+ |> shouldSucceed
+ |> verifyIL ["""
+IL_0000: ldstr "ab"
+IL_0005: ldstr "c"
+IL_000a: ldstr "d"
+IL_000f: call string [runtime]System.String::Concat(string,
+ string,
+ string)"""]
+
+ []
+ let ``Interpolated string with 4 parts consisting only of strings is lowered to concat`` () =
+ let str = "$\"\"\"a{\"b\"}{\"c\"}d\"\"\""
+ FSharp $"""
+module StringFormatAndInterpolation
+
+let str () = {str}
+ """
+ |> withLangVersionPreview
+ |> compile
+ |> shouldSucceed
+ |> verifyIL ["""
+IL_0000: ldstr "a"
+IL_0005: ldstr "b"
+IL_000a: ldstr "c"
+IL_000f: ldstr "d"
+IL_0014: call string [runtime]System.String::Concat(string,
+ string,
+ string,
+ string)
+IL_0019: ret"""]
\ No newline at end of file
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs
index 56572879715..9d34b2466e6 100644
--- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs
@@ -1440,7 +1440,7 @@ namespace N
]
[]
- let ``Warn about attribute on non-recursive let-bound value`` () =
+ let ``Error about attribute on non-recursive let-bound value`` () =
"""
namespace N
@@ -1453,18 +1453,10 @@ namespace N
|> withLangVersionPreview
|> compile
|> shouldFail
- |> withResults [
- { Error = Warning 3861
- Range = { StartLine = 7
- StartColumn = 13
- EndLine = 7
- EndColumn = 18 }
- Message =
- "The TailCall attribute should only be applied to recursive functions." }
- ]
+ |> withSingleDiagnostic (Error 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element")
[]
- let ``Warn about attribute on recursive let-bound value`` () =
+ let ``Error about attribute on recursive let-bound value`` () =
"""
namespace N
@@ -1477,15 +1469,7 @@ namespace N
|> withLangVersionPreview
|> compile
|> shouldFail
- |> withResults [
- { Error = Warning 3861
- Range = { StartLine = 7
- StartColumn = 17
- EndLine = 7
- EndColumn = 37 }
- Message =
- "The TailCall attribute should only be applied to recursive functions." }
- ]
+ |> withSingleDiagnostic (Error 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element")
[]
let ``Warn about self-defined attribute`` () = // is the analysis available for users of older FSharp.Core versions
diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
index ec4fc441f29..ebfe6938aa8 100644
--- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
+++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
@@ -3,8 +3,8 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
Library
false
true
diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs
index cbc8e7690fe..3a8730043a3 100644
--- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs
+++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs
@@ -3,6 +3,7 @@
open System.Collections.Concurrent
open System.Diagnostics
open FSharp.Compiler.CodeAnalysis
+open FSharp.Compiler.Text
open Internal.Utilities.Collections
open FSharp.Compiler.CodeAnalysis.TransparentCompiler
open Internal.Utilities.Library.Extras
@@ -645,10 +646,12 @@ let fuzzingTest seed (project: SyntheticProject) = task {
}
+(* This gets in the way of insertions too often now, uncomment when stable.
[]
[]
[]
[]
+*)
let Fuzzing signatureFiles =
let seed = System.Random().Next()
@@ -894,4 +897,66 @@ let ``LoadClosure for script is recomputed after changes`` () =
|> Seq.map (fun (k, g) -> k, g |> Seq.map fst |> Seq.toList)
|> Map
- Assert.Equal([Weakened; Requested; Started; Finished; Weakened; Requested; Started; Finished], closureComputations["FileFirst.fs"])
\ No newline at end of file
+ Assert.Equal([Weakened; Requested; Started; Finished; Weakened; Requested; Started; Finished], closureComputations["FileFirst.fs"])
+
+[]
+let ``TryGetRecentCheckResultsForFile returns None before first call to ParseAndCheckFileInProject`` () =
+ let project = SyntheticProject.Create(
+ sourceFile "First" [])
+
+ ProjectWorkflowBuilder(project) {
+ clearCache
+ tryGetRecentCheckResults "First" expectNone
+ } |> ignore
+
+[]
+let ``TryGetRecentCheckResultsForFile returns result after first call to ParseAndCheckFileInProject`` () =
+ let project = SyntheticProject.Create(
+ sourceFile "First" [] )
+
+ ProjectWorkflowBuilder(project) {
+ tryGetRecentCheckResults "First" expectSome
+ } |> ignore
+
+[]
+let ``TryGetRecentCheckResultsForFile returns no result after edit`` () =
+ let project = SyntheticProject.Create(
+ sourceFile "First" [])
+
+ ProjectWorkflowBuilder(project) {
+ tryGetRecentCheckResults "First" expectSome
+ updateFile "First" updatePublicSurface
+ tryGetRecentCheckResults "First" expectNone
+ checkFile "First" expectOk
+ tryGetRecentCheckResults "First" expectSome
+ } |> ignore
+
+[]
+let ``TryGetRecentCheckResultsForFile returns result after edit of other file`` () =
+ let project = SyntheticProject.Create(
+ sourceFile "First" [],
+ sourceFile "Second" ["First"])
+
+ ProjectWorkflowBuilder(project) {
+ tryGetRecentCheckResults "First" expectSome
+ tryGetRecentCheckResults "Second" expectSome
+ updateFile "First" updatePublicSurface
+ tryGetRecentCheckResults "First" expectNone
+ tryGetRecentCheckResults "Second" expectSome // file didn't change so we still want to get the recent result
+ } |> ignore
+
+[]
+let ``Background compiler and Transparent compiler return the same options`` () =
+ async {
+ let backgroundChecker = FSharpChecker.Create(useTransparentCompiler = false)
+ let transparentChecker = FSharpChecker.Create(useTransparentCompiler = true)
+ let scriptName = Path.Combine(__SOURCE_DIRECTORY__, "script.fsx")
+ let content = SourceTextNew.ofString ""
+
+ let! backgroundSnapshot, backgroundDiags = backgroundChecker.GetProjectSnapshotFromScript(scriptName, content)
+ let! transparentSnapshot, transparentDiags = transparentChecker.GetProjectSnapshotFromScript(scriptName, content)
+ Assert.Empty(backgroundDiags)
+ Assert.Empty(transparentDiags)
+ Assert.Equal(backgroundSnapshot.OtherOptions, transparentSnapshot.OtherOptions)
+ Assert.Equal(backgroundSnapshot.ReferencesOnDisk, transparentSnapshot.ReferencesOnDisk)
+ }
diff --git a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs
index c8f2eafa937..7c82ac3d88e 100644
--- a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs
+++ b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs
@@ -128,4 +128,49 @@ type Foo () =
x
"""
|> compile
- |> shouldSucceed
\ No newline at end of file
+ |> shouldSucceed
+
+ []
+ // Test different number of interpolated string parts
+ []
+ []
+ []
+ let ``Interpolated expressions are strings`` (strToPrint: string) =
+ Fsx $"""
+let x = {strToPrint}
+printfn "%%s" x
+ """
+ |> withLangVersionPreview
+ |> compileExeAndRun
+ |> shouldSucceed
+ |> withStdOutContains "abcde"
+
+ let ``Multiline interpolated expression is a string`` () =
+ let strToPrint = String.Join(Environment.NewLine, "$\"\"\"a", "b", "c", "{\"d\"}", "e\"\"\"")
+ Fsx $"""
+let x = {strToPrint}
+printfn "%%s" x
+ """
+ |> withLangVersionPreview
+ |> compileExeAndRun
+ |> shouldSucceed
+ |> withStdOutContains """a
+b
+c
+d
+e"""
+
+ []
+ []
+ []
+ []
+ let ``In FormattableString, interpolated expressions are strings`` (formattableStr: string, argCount: int) =
+ Fsx $"""
+let x = {formattableStr} : System.FormattableString
+assert(x.ArgumentCount = {argCount})
+printfn "%%s" (System.Globalization.CultureInfo "en-US" |> x.ToString)
+ """
+ |> withLangVersionPreview
+ |> compileExeAndRun
+ |> shouldSucceed
+ |> withStdOutContains "abcde"
\ No newline at end of file
diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs
index 80f7caecafb..524556dae0a 100644
--- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs
+++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs
@@ -796,6 +796,8 @@ type Foo = class end
sourceFile
"Program"
"""
+module Program
+
printfn "Hello"
"""
Set.empty
@@ -907,6 +909,35 @@ do
module Bar
let _ = nameof ((Foo))
+"""
+ (set [| 0 |])
+ ]
+ scenario
+ "prefixed module name in nameof expression"
+ [
+ sourceFile "A.fs" "module X.Y.Z" Set.empty
+ sourceFile
+ "B.fs"
+ """
+module B
+
+open System.ComponentModel
+
+[]
+let v = 2
+"""
+ (set [| 0 |])
+ ]
+ scenario
+ "prefixed module name in nameof pattern"
+ [
+ sourceFile "A.fs" "module X.Y.Z" Set.empty
+ sourceFile
+ "B.fs"
+ """
+module B
+
+do ignore (match "" with | nameof X.Y.Z -> () | _ -> ())
"""
(set [| 0 |])
]
diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj
index cdfd467e5c3..8f69b337c5a 100644
--- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj
+++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj
@@ -2,8 +2,8 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
Library
true
xunit
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
index da61adbe19b..3c4b22f76c1 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
@@ -2038,6 +2038,8 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: FSharp.Compiler.Symbols.
FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String ToString()
FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] DependencyFiles
FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] get_DependencyFiles()
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean UsesTransparentCompiler
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean get_UsesTransparentCompiler()
FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Instance
FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Instance()
@@ -2065,6 +2067,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] GetBackgroundCheckResultsForFileInProject(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String])
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32]] Compile(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpParsingOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
@@ -2076,6 +2079,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Mi
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]],System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]] get_BeforeBackgroundFileCheck()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]],System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]] get_FileChecked()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]],System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]] get_FileParsed()
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] TryGetRecentCheckResultsForFile(System.String, FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults,System.Int64]] TryGetRecentCheckResultsForFile(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.ISourceText], Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParsingOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]] GetParsingOptionsFromCommandLineArgs(Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
FSharp.Compiler.CodeAnalysis.FSharpChecker: System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParsingOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]] GetParsingOptionsFromCommandLineArgs(Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
@@ -2086,6 +2090,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearCache(System.Collections.G
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateAll()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsBindingALambdaAtPosition(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPosContainedInApplication(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPositionContainedInACurriedParameter(FSharp.Compiler.Text.Position)
@@ -2330,15 +2335,39 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.Str
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.String get_projectFileName()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.String outputFileName
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.String projectFileName
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean IsIncompleteTypeCheckEnvironment
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean UseScriptResolutionRules
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean get_IsIncompleteTypeCheckEnvironment()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean get_UseScriptResolutionRules()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectIdentifier Identifier
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectIdentifier get_Identifier()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Create(System.String, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk], Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot], Boolean, Boolean, System.DateTime, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.Int64])
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Replace(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot])
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot] SourceFiles
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot] get_SourceFiles()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot] ReferencedProjects
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot] get_ReferencedProjects()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk] ReferencesOnDisk
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk] get_ReferencesOnDisk()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.String] OtherOptions
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.String] get_OtherOptions()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]] OriginalLoadReferences
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]] get_OriginalLoadReferences()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, FSharp.Compiler.CodeAnalysis.DocumentSource)
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot]]], Microsoft.FSharp.Core.FSharpOption`1[System.Collections.Generic.Dictionary`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot]])
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.DocumentSource)
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet] UnresolvedReferences
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet] get_UnresolvedReferences()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.Int64] Stamp
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.Int64] get_Stamp()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.String] ProjectId
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_ProjectId()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.DateTime LoadTime
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.DateTime get_LoadTime()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String Label
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String ProjectFileName
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String get_Label()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String get_ProjectFileName()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: FSharpProjectSnapshot get_snapshot()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: FSharpProjectSnapshot snapshot
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: System.String get_projectOutputFile()
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
index da61adbe19b..3c4b22f76c1 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
@@ -2038,6 +2038,8 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: FSharp.Compiler.Symbols.
FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String ToString()
FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] DependencyFiles
FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] get_DependencyFiles()
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean UsesTransparentCompiler
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean get_UsesTransparentCompiler()
FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Instance
FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Instance()
@@ -2065,6 +2067,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] GetBackgroundCheckResultsForFileInProject(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String])
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32]] Compile(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpParsingOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
@@ -2076,6 +2079,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Mi
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]],System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]] get_BeforeBackgroundFileCheck()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]],System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]] get_FileChecked()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]],System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]] get_FileParsed()
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] TryGetRecentCheckResultsForFile(System.String, FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults,System.Int64]] TryGetRecentCheckResultsForFile(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.ISourceText], Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParsingOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]] GetParsingOptionsFromCommandLineArgs(Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
FSharp.Compiler.CodeAnalysis.FSharpChecker: System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParsingOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]] GetParsingOptionsFromCommandLineArgs(Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
@@ -2086,6 +2090,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearCache(System.Collections.G
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateAll()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
+FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsBindingALambdaAtPosition(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPosContainedInApplication(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPositionContainedInACurriedParameter(FSharp.Compiler.Text.Position)
@@ -2330,15 +2335,39 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.Str
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.String get_projectFileName()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.String outputFileName
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectIdentifier: System.String projectFileName
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean IsIncompleteTypeCheckEnvironment
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean UseScriptResolutionRules
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean get_IsIncompleteTypeCheckEnvironment()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Boolean get_UseScriptResolutionRules()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectIdentifier Identifier
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectIdentifier get_Identifier()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Create(System.String, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk], Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot], Boolean, Boolean, System.DateTime, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.Int64])
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Replace(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot])
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot] SourceFiles
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot] get_SourceFiles()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot] ReferencedProjects
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot] get_ReferencedProjects()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk] ReferencesOnDisk
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk] get_ReferencesOnDisk()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.String] OtherOptions
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.String] get_OtherOptions()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]] OriginalLoadReferences
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]] get_OriginalLoadReferences()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, FSharp.Compiler.CodeAnalysis.DocumentSource)
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot]]], Microsoft.FSharp.Core.FSharpOption`1[System.Collections.Generic.Dictionary`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot]])
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.DocumentSource)
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet] UnresolvedReferences
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet] get_UnresolvedReferences()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.Int64] Stamp
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.Int64] get_Stamp()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.String] ProjectId
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_ProjectId()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.DateTime LoadTime
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.DateTime get_LoadTime()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String Label
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String ProjectFileName
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String get_Label()
+FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String get_ProjectFileName()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: FSharpProjectSnapshot get_snapshot()
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: FSharpProjectSnapshot snapshot
FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: System.String get_projectOutputFile()
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 780ba10f3f4..59b5fc43d65 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
@@ -3,8 +3,8 @@
Exe
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
$(NoWarn);44;75;
true
false
diff --git a/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs b/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs
index 556a9b5bc42..d07b23a5e99 100644
--- a/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs
+++ b/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs
@@ -235,22 +235,36 @@ module BuildGraphTests =
Assert.shouldBeTrue graphNode.HasValue
Assert.shouldBe (ValueSome 1) (graphNode.TryPeekValue())
-
+ type ExampleException(msg) = inherit System.Exception(msg)
+
[]
let internal ``NodeCode preserves DiagnosticsThreadStatics`` () =
let random =
let rng = Random()
fun n -> rng.Next n
- let job phase _ = node {
+ let job phase i = node {
do! random 10 |> Async.Sleep |> NodeCode.AwaitAsync
Assert.Equal(phase, DiagnosticsThreadStatics.BuildPhase)
+ DiagnosticsThreadStatics.DiagnosticsLogger.DebugDisplay()
+ |> Assert.shouldBe $"DiagnosticsLogger(NodeCode.Parallel {i})"
+
+ errorR (ExampleException $"job {i}")
}
let work (phase: BuildPhase) =
node {
- use _ = new CompilationGlobalsScope(DiscardErrorsLogger, phase)
- let! _ = Seq.init 8 (job phase) |> NodeCode.Parallel
+ let n = 8
+ let logger = CapturingDiagnosticsLogger("test NodeCode")
+ use _ = new CompilationGlobalsScope(logger, phase)
+ let! _ = Seq.init n (job phase) |> NodeCode.Parallel
+
+ let diags = logger.Diagnostics |> List.map fst
+
+ diags |> List.map _.Phase |> Set |> Assert.shouldBe (Set.singleton phase)
+ diags |> List.map _.Exception.Message
+ |> Assert.shouldBe (List.init n <| sprintf "job %d")
+
Assert.Equal(phase, DiagnosticsThreadStatics.BuildPhase)
}
diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj
index 0e4b91b42a7..dd3e21cea91 100644
--- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj
+++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj
@@ -3,8 +3,8 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
Library
true
$(DefineConstants);ASSUME_PREVIEW_FSHARP_CORE
diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
index 4b6c5c53481..9acbcef398e 100644
--- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
+++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
@@ -3,8 +3,8 @@
- net8.0;net472
- net8.0
+ $(FSharpNetCoreProductTargetFramework);net472
+ $(FSharpNetCoreProductTargetFramework)
Library
FSharp.Core.UnitTests
diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj
index 8c18161775f..0bee6d1e015 100644
--- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj
+++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj
@@ -1,8 +1,8 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
win-x86;win-x64;linux-x64;osx-x64
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81
true
diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs
index 2157d8fb7fe..998f2bd201d 100644
--- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs
+++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs
@@ -754,7 +754,13 @@ module ProjectOperations =
|> Seq.toArray
Assert.Equal<(string * int * int * int)[]>(expected |> Seq.sort |> Seq.toArray, actual)
-
+
+ let expectNone x =
+ if Option.isSome x then failwith "expected None, but was Some"
+
+ let expectSome x =
+ if Option.isNone x then failwith "expected Some, but was None"
+
let rec saveProject (p: SyntheticProject) generateSignatureFiles checker =
async {
Directory.CreateDirectory(p.ProjectDir) |> ignore
@@ -1346,6 +1352,28 @@ type ProjectWorkflowBuilder
exn $"Compilation failed with exit code {exitCode}" |> raise
return ctx
}
+
+ []
+ member this.TryGetRecentCheckResults(workflow: Async, fileId: string, expected) =
+ async {
+ let! ctx = workflow
+ let project, file = ctx.Project.FindInAllProjects fileId
+ let fileName = project.ProjectDir ++ file.FileName
+ let options = project.GetProjectOptions checker
+ let! snapshot = FSharpProjectSnapshot.FromOptions(options, getFileSnapshot ctx.Project)
+ let r = checker.TryGetRecentCheckResultsForFile(fileName, snapshot)
+ expected r
+
+ match r with
+ | Some(parseFileResults, checkFileResults) ->
+ let signature = getSignature(parseFileResults, FSharpCheckFileAnswer.Succeeded(checkFileResults))
+ match ctx.Signatures.TryFind(fileId) with
+ | Some priorSignature -> Assert.Equal(priorSignature, signature)
+ | None -> ()
+ | None -> ()
+
+ return ctx
+ }
/// Execute a set of operations on a given synthetic project.
/// The project is saved to disk and type checked at the start.
diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj
index 50bba8f6f23..168c8b546e6 100644
--- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj
+++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj
@@ -1,7 +1,7 @@
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
Library
8.0
diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj
index 919c4cc073c..c96d342298f 100644
--- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj
+++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj
@@ -1,6 +1,6 @@
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
Exe
true
diff --git a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj
index 9706167ff62..31d404fb061 100644
--- a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj
+++ b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj
@@ -1,7 +1,7 @@
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
Exe
true
diff --git a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj
index d23714e40f2..29148a7450d 100644
--- a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj
+++ b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj
@@ -1,7 +1,7 @@
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
Library
8.0
diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj
index fe6d95f9050..1781b4784dc 100644
--- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj
+++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj
@@ -1,7 +1,7 @@
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
HistoricalBenchmark.Utilities
$(NoWarn);NETSDK1206
diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj
index 09ca5cb6912..48cfa7b4975 100644
--- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj
+++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
Release
diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs
index 2b28cdce001..44a0f9fdaaf 100644
--- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs
+++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs
@@ -105,7 +105,8 @@ type CompilerServiceBenchmarks() =
| Some _ -> configOpt
| None ->
let checker = FSharpChecker.Create(projectCacheSize = 200)
- let source = FSharpSourceText.From(File.OpenRead("""..\..\..\..\..\..\..\..\..\src\Compiler\Checking\CheckExpressions.fs"""), Encoding.Default, FSharpSourceHashAlgorithm.Sha1, true)
+ let path = __SOURCE_DIRECTORY__ ++ ".." ++ ".." ++ ".." ++ ".." ++ "src" ++ "Compiler" ++ "Checking" ++ "CheckExpressions.fs"
+ let source = FSharpSourceText.From(File.OpenRead(path), Encoding.Default, FSharpSourceHashAlgorithm.Sha1, true)
let assemblies =
AppDomain.CurrentDomain.GetAssemblies()
|> Array.map (fun x -> x.Location)
diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj
index 043de02d374..c7a873a2cc4 100644
--- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj
+++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
false
diff --git a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj
index 92255adb462..265ab45ac19 100644
--- a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj
+++ b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
diff --git a/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj b/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj
index 2e6b2e9ceb7..615a5ab3a77 100644
--- a/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj
+++ b/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj
@@ -1,7 +1,7 @@
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
diff --git a/tests/benchmarks/SmokeTestBenchmarks.ps1 b/tests/benchmarks/SmokeTestBenchmarks.ps1
index 710d8c3e2ba..4d5cda02c7c 100644
--- a/tests/benchmarks/SmokeTestBenchmarks.ps1
+++ b/tests/benchmarks/SmokeTestBenchmarks.ps1
@@ -9,7 +9,7 @@ function Run {
dotnet run `
--project $path `
- -c release `
+ -c Release `
--no-build `
--job Dry `
--allCategories short `
diff --git a/tests/benchmarks/SmokeTestBenchmarks.sh b/tests/benchmarks/SmokeTestBenchmarks.sh
index 0da2c8f2213..75fcd54ec7f 100755
--- a/tests/benchmarks/SmokeTestBenchmarks.sh
+++ b/tests/benchmarks/SmokeTestBenchmarks.sh
@@ -6,7 +6,7 @@ run() {
local path=$1
dotnet run \
--project $path \
- -c release \
+ -c Release \
--no-build \
--job Dry \
--allCategories short \
diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj
index b6d69d8ae1a..ac97046351b 100644
--- a/tests/fsharp/FSharpSuite.Tests.fsproj
+++ b/tests/fsharp/FSharpSuite.Tests.fsproj
@@ -2,8 +2,8 @@
- net472;net8.0
- net8.0
+ net472;$(FSharpNetCoreProductTargetFramework)
+ $(FSharpNetCoreProductTargetFramework)
win-x86;win-x64
$(AssetTargetFallback);portable-net45+win8+wp8+wpa81
true
diff --git a/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj b/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj
index 13d42aeb283..6fa21d9b264 100644
--- a/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj
+++ b/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj
@@ -2,13 +2,13 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
true
- $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll
- $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll
+ $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll
+ $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll
False
True
diff --git a/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj b/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj
index bf06c1ce7a3..94e78cddcfc 100644
--- a/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj
+++ b/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj
@@ -2,13 +2,13 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
preview
- $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll
- $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll
+ $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll
+ $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll
False
True
diff --git a/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj b/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj
index c2164b65666..4f47ab1a711 100644
--- a/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj
+++ b/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj
@@ -2,15 +2,15 @@
Exe
- net8.0
+ $(FSharpNetCoreProductTargetFramework)
preview
true
true
- $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll
- $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll
+ $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll
+ $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll
False
True
diff --git a/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj b/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj
index 92c5ae861d4..45f9002aa14 100644
--- a/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj
+++ b/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj
@@ -7,7 +7,7 @@
- $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll
+ $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll
diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs
index 8a643c9a7bc..901484b6a1c 100644
--- a/tests/service/ProjectAnalysisTests.fs
+++ b/tests/service/ProjectAnalysisTests.fs
@@ -7,6 +7,8 @@
module Tests.Service.ProjectAnalysisTests
#endif
+#nowarn "57" // Experimental stuff
+
let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with e -> false
open NUnit.Framework
@@ -4653,7 +4655,7 @@ let callToOverload = B(5).Overload(4)
let args = mkProjectCommandLineArgs (dllName, [])
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``Test project36 FSharpMemberOrFunctionOrValue.IsBaseValue`` useTransparentCompiler =
let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=useTransparentCompiler)
@@ -4670,7 +4672,7 @@ let ``Test project36 FSharpMemberOrFunctionOrValue.IsBaseValue`` useTransparentC
|> fun baseSymbol -> shouldEqual true baseSymbol.IsBaseValue
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``Test project36 FSharpMemberOrFunctionOrValue.IsConstructorThisValue & IsMemberThisValue`` useTransparentCompiler =
let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=useTransparentCompiler)
@@ -4709,7 +4711,7 @@ let ``Test project36 FSharpMemberOrFunctionOrValue.IsConstructorThisValue & IsMe
|> shouldEqual true
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``Test project36 FSharpMemberOrFunctionOrValue.LiteralValue`` useTransparentCompiler =
let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=useTransparentCompiler)
@@ -4749,17 +4751,17 @@ type TestRecord = { B : int }
module Test =
[)>]
- let withType = 0
+ let withType() = 0
[>)>]
- let withGenericType = 0
+ let withGenericType() = 0
[)>]
- let withTupleType = 0
+ let withTupleType() = 0
[ int>)>]
- let withFuncType = 0
+ let withFuncType() = 0
[; typeof |])>]
- let withTypeArray = 0
+ let withTypeArray() = 0
[]
- let withIntArray = 0
+ let withIntArray() = 0
module NestedModule =
type NestedRecordType = { B : int }
@@ -5327,7 +5329,7 @@ let foo (a: Foo): bool =
let options = { checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) with SourceFiles = fileNames }
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``Test typed AST for struct unions`` useTransparentCompiler = // See https://github.com/fsharp/FSharp.Compiler.Service/issues/756
let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=useTransparentCompiler)
@@ -5417,7 +5419,7 @@ let ``Test diagnostics with line directives ignored`` () =
//------------------------------------------------------
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``ParseAndCheckFileResults contains ImplFile list if FSharpChecker is created with keepAssemblyContent flag set to true`` useTransparentCompiler =
@@ -5460,6 +5462,65 @@ type A(i:int) =
| Some decl -> failwithf "unexpected declaration %A" decl
| None -> failwith "declaration list is empty"
+[]
+// [] // Flaky, reenable when stable
+[]
+let ``TryGetRecentCheckResultsForFile called with snapshot returns cached result after ParseAndCheckFile`` useTransparentCompiler =
+ let fileName1 = Path.ChangeExtension(tryCreateTemporaryFileName (), ".fs")
+ let base2 = tryCreateTemporaryFileName ()
+ let dllName = Path.ChangeExtension(base2, ".dll")
+ let projFileName = Path.ChangeExtension(base2, ".fsproj")
+ let fileSource1Text = """
+type A(i:int) =
+ member x.Value = i
+"""
+ let fileSource1 = SourceText.ofString fileSource1Text
+ FileSystem.OpenFileForWriteShim(fileName1).Write(fileSource1Text)
+
+ let fileNames = [|fileName1|]
+ let args = mkProjectCommandLineArgs (dllName, [])
+ let checker = FSharpChecker.Create(useTransparentCompiler=useTransparentCompiler)
+ let options = { checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) with SourceFiles = fileNames }
+ let snapshot = FSharpProjectSnapshot.FromOptions(options, DocumentSource.FileSystem) |> Async.RunImmediate
+
+ let rbefore = checker.TryGetRecentCheckResultsForFile(fileName1, snapshot)
+ match rbefore with
+ | Some(fileResults, checkFileResults) -> failwith "cached results before ParseAndCheckFileInProject was called"
+ | None -> ()
+
+ checker.ParseAndCheckFileInProject(fileName1, snapshot) |> Async.RunImmediate
+ |> function
+ | _, FSharpCheckFileAnswer.Succeeded(res) -> ()
+ | _ -> failwithf "Parsing aborted unexpectedly..."
+
+ let rafterCheckResults = checker.TryGetRecentCheckResultsForFile(fileName1, snapshot)
+ match rafterCheckResults with
+ | Some(fileResults, checkFileResults) -> ()
+ | None -> failwith "no results from TryGetRecentCheckResultsForFile"
+
+ let fileSource1TextEdited = """
+type A(i:int) =
+ member x.Value = i
+ member x.Value2 = 23
+"""
+ let fileSource1Edited = SourceText.ofString fileSource1TextEdited
+ FileSystem.OpenFileForWriteShim(fileName1).Write(fileSource1TextEdited)
+ let snapshotAfterFileEdit = FSharpProjectSnapshot.FromOptions(options, DocumentSource.FileSystem) |> Async.RunImmediate
+
+ let rafterEditBefore2ndCheckResults = checker.TryGetRecentCheckResultsForFile(fileName1, snapshotAfterFileEdit)
+ match rafterEditBefore2ndCheckResults with
+ | Some(fileResults, checkFileResults) -> failwith "stale cache results from TryGetRecentCheckResultsForFile after edit"
+ | None -> ()
+
+ checker.ParseAndCheckFileInProject(fileName1, snapshotAfterFileEdit) |> Async.RunImmediate
+ |> function
+ | _, FSharpCheckFileAnswer.Succeeded(res) -> ()
+ | _ -> failwithf "Parsing aborted unexpectedly..."
+
+ let rafterEditAfter2ndCheckResults = checker.TryGetRecentCheckResultsForFile(fileName1, snapshotAfterFileEdit)
+ match rafterEditAfter2ndCheckResults with
+ | Some(fileResults, checkFileResults) -> ()
+ | None -> failwith "no results from TryGetRecentCheckResultsForFile"
[]
[]
@@ -5477,7 +5538,7 @@ let ``#4030, Incremental builder creation warnings`` (args, errorSeverities) =
//------------------------------------------------------
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``Unused opens in rec module smoke test 1`` useTransparentCompiler =
@@ -5552,7 +5613,7 @@ type UseTheThings(i:int) =
unusedOpensData |> shouldEqual expected
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``Unused opens in non rec module smoke test 1`` useTransparentCompiler =
@@ -5627,7 +5688,7 @@ type UseTheThings(i:int) =
unusedOpensData |> shouldEqual expected
[]
-[]
+// [] // Flaky, reenable when stable
[]
let ``Unused opens smoke test auto open`` useTransparentCompiler =
@@ -5800,4 +5861,4 @@ module internal EmptyProject =
let ``Empty source list produces error FS0207`` () =
let results = checker.ParseAndCheckProject(EmptyProject.options) |> Async.RunImmediate
results.Diagnostics.Length |> shouldEqual 1
- results.Diagnostics[0].ErrorNumber |> shouldEqual 207
\ No newline at end of file
+ results.Diagnostics[0].ErrorNumber |> shouldEqual 207