From bd18e1e8d6ea58aadccd4d0b3e1b0a98b3bc442f Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 6 Aug 2026 12:30:16 +0200 Subject: [PATCH 1/4] Set default F# language version to 11.0 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/Compiler/Facilities/LanguageFeatures.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index ad170712e4a..769e93016cc 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -128,7 +128,7 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) static let languageVersion100 = 10.0m static let languageVersion110 = 11.0m static let previewVersion = 9999m // Language version when preview specified - static let defaultVersion = languageVersion100 // Language version when default specified + static let defaultVersion = languageVersion110 // Language version when default specified static let latestVersion = defaultVersion // Language version when latest specified static let latestMajorVersion = defaultVersion // Language version when latestmajor specified From f89f986f7c94fd5ac8f2ee254b8e27ad1eca7425 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 6 Aug 2026 13:09:51 +0200 Subject: [PATCH 2/4] Pin feature-off tests to F# 10.0 for the 11.0 default bump The default language version bump to 11.0 turns on DirectDelegateConstruction, ErrorOnMissingSignatureAttribute (FS3888 warning->error) and ExceptionFieldSerializationSupport by default. Pin the tests that capture the pre-11 (feature-off) behavior to --langversion:10.0 so they keep exercising it; the 11.0 behavior is already covered by the existing preview/explicit twins. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../Conformance/Signatures/SignatureEnforcedAttributes.fs | 2 ++ .../EmittedIL/DirectDelegates/DirectDelegates.fs | 2 ++ .../EmittedIL/Nullness/NullnessMetadata.fs | 1 + .../EmittedIL/SerializableAttribute/SerializableAttribute.fs | 1 + 4 files changed, 6 insertions(+) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Signatures/SignatureEnforcedAttributes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Signatures/SignatureEnforcedAttributes.fs index e9a7639999a..eae5eca01a1 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Signatures/SignatureEnforcedAttributes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Signatures/SignatureEnforcedAttributes.fs @@ -16,6 +16,7 @@ module SignatureEnforcedAttributes = |> FS |> withAdditionalSourceFile (fs implSrc) |> asLibrary + |> withLangVersion10 // FS3888 is a warning pre-11 and an error at 11.0 (ErrorOnMissingSignatureAttribute); pin to the warning behavior |> ignoreWarnings |> compile @@ -265,6 +266,7 @@ let inline f (x: int) = x + 1 |> FS |> withAdditionalSourceFile (fs implSrc) |> asLibrary + |> withLangVersion10 // #nowarn suppresses FS3888 only while it is a warning (pre-11); at 11.0 it is an error |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/DirectDelegates/DirectDelegates.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/DirectDelegates/DirectDelegates.fs index f247d1c2210..e2c93ccedcd 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/DirectDelegates/DirectDelegates.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/DirectDelegates/DirectDelegates.fs @@ -17,6 +17,7 @@ let private coreOptions compilation = let verifyCompilation compilation = compilation |> coreOptions + |> withLangVersion10 // default baseline captures the pre-11 closure IL; DirectDelegateConstruction (11.0) is covered by the preview twin |> compile |> shouldSucceed |> verifyPEFileWithSystemDlls @@ -212,6 +213,7 @@ let main _ = if d.Method.Name <> "Invoke" then failwithf "expected closure Method.Name 'Invoke' but got '%s'" d.Method.Name 0 """ + |> withLangVersion10 // "without the feature": DirectDelegateConstruction is off pre-11, so the delegate goes through a closure |> compileExeAndRun |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs index e4d4243b300..e4dcfbcb43b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs @@ -70,6 +70,7 @@ module NullnessMetadata = let ``Nullable attr for exception types`` compilation = compilation |> getCompilation + |> withLangVersion10 // ExceptionFieldSerializationSupport (11.0) changes exception IL; pin to pre-11 (nullness stays on, gated at 9.0) |> verifyCompilation DoNotOptimize [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs index 4ba73a4b8da..e44f160a974 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs @@ -15,6 +15,7 @@ module SerializableAttribute = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> withLangVersion10 // baselines capture pre-11 serialization IL; ExceptionFieldSerializationSupport (11.0) is off here |> compile |> verifyILBaseline From 9f03bb333d7f5f53b5694dcd6881041d0f7bbaa5 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 6 Aug 2026 13:56:44 +0200 Subject: [PATCH 3/4] Pin StaticMember delegate-codegen tests to F# 10.0 for the 11.0 default bump DirectDelegateConstruction (on by default at 11.0) collapses the delegate-from-static-method closures these baselines expect. The 11.0 form is covered by EmittedIL/DirectDelegates. The EventHandler case is WinForms-gated so it only surfaces on Windows CI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../Compiler/CodeGen/EmittedIL/StaticMember.fs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs index 078cffd9e60..6a13f7f83ad 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs @@ -8,9 +8,13 @@ open Xunit module ``Static Member`` = + // The delegate-from-method cases below are pinned to --langversion:10.0: at F# 11.0 (now the default) + // DirectDelegateConstruction builds the delegate straight from the target method, dropping the closure + // class this IL expects. The 11.0 form is covered by EmittedIL/DirectDelegates. + [] let ``Action on Static Member``() = - CompilerAssert.CompileLibraryAndVerifyILRealSig( + CompilerAssert.CompileLibraryAndVerifyILWithOptions([| "--realsig+"; "--langversion:10.0" |], """ module StaticMember01 @@ -74,7 +78,7 @@ type C = [] let ``Action on Static Member with lambda``() = - CompilerAssert.CompileLibraryAndVerifyILRealSig( + CompilerAssert.CompileLibraryAndVerifyILWithOptions([| "--realsig+"; "--langversion:10.0" |], """ module StaticMember02 @@ -247,7 +251,7 @@ let main _ = [] let ``Func on Static Member``() = - CompilerAssert.CompileLibraryAndVerifyILRealSig( + CompilerAssert.CompileLibraryAndVerifyILWithOptions([| "--realsig+"; "--langversion:10.0" |], """ module StaticMember04 @@ -313,7 +317,7 @@ type C = [] let ``Func on Static Member with lambda``() = - CompilerAssert.CompileLibraryAndVerifyILRealSig( + CompilerAssert.CompileLibraryAndVerifyILWithOptions([| "--realsig+"; "--langversion:10.0" |], """ module StaticMember05 @@ -434,7 +438,8 @@ let main _ = #if !FX_NO_WINFORMS [] let ``EventHandler from Regression/83``() = - CompilerAssert.CompileLibraryAndVerifyILRealSig( + // Same pin as the cases above; WinForms-gated, so this one only runs on Windows CI. + CompilerAssert.CompileLibraryAndVerifyILWithOptions([| "--realsig+"; "--langversion:10.0" |], """ module StaticMember07 From 3a8aac95a538a831a181e6b10cd93c26a0780565 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 6 Aug 2026 15:45:20 +0200 Subject: [PATCH 4/4] Pin Desktop-only feature-off tests to F# 10.0 for the 11.0 default bump Two net472/Desktop-only tests were masked off-Windows and only broke on the Windows CI legs after the default language version moved to 11.0: - neg12 (typecheck/sigs): AccessProtectedBaseFieldFromClosure is now on by default, so the protected-member-from-closure cases compile and three FS0491 baseline errors vanish. Pinned to 10.0; 11.0 behavior is covered by dedicated conformance tests. - core/attributes (FSC_OPTIMIZED + FSI): ErrorOnMissingSignatureAttribute turns FS3888 (attribute present on impl but not signature) from warning into error. The test deliberately exercises this sig/impl attribute difference. Pinned to 10.0; 11.0 behavior is covered by Conformance/Signatures/SignatureEnforcedAttributes. Adds a V10 case to the test LangVersion DU (ScriptHelpers.fs) and the two exhaustive match sites (ScriptHelpers baseArgs, FsharpSuiteMigrated adjustVersion). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 031e1fed-5836-4262-b22e-b0ebcd96c31b --- .../Miscellaneous/FsharpSuiteMigrated.fs | 1 + .../Miscellaneous/MigratedTypeCheckTests.fs | 4 +++- tests/FSharp.Test.Utilities/ScriptHelpers.fs | 2 ++ tests/fsharp/tests.fs | 7 +++++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs index e0cfdff2ffd..b976f60d438 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs @@ -86,6 +86,7 @@ module TestFrameworkAdapter = match version with | LangVersion.V80 -> "8.0",bonusArgs | LangVersion.V90 -> "9.0",bonusArgs + | LangVersion.V10 -> "10.0",bonusArgs | LangVersion.Preview -> "preview",bonusArgs | LangVersion.Latest -> "latest", bonusArgs diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs index 208a60327b4..ba474291d04 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs @@ -46,7 +46,9 @@ let ``type check neg10_a`` () = singleNegTest ( "typecheck/sigs") "neg10_a" let ``type check neg11`` () = singleNegTest ( "typecheck/sigs") "neg11" [] -let ``type check neg12`` () = singleNegTest ( "typecheck/sigs") "neg12" +// Pinned to 10.0: at 11.0 AccessProtectedBaseFieldFromClosure lets the protected-member-from-closure +// cases compile, dropping baseline errors. 11.0 behavior is covered by dedicated conformance tests. +let ``type check neg12`` () = singleVersionedNegTest ("typecheck/sigs") LangVersion.V10 "neg12" [] let ``type check neg13`` () = singleNegTest ( "typecheck/sigs") "neg13" diff --git a/tests/FSharp.Test.Utilities/ScriptHelpers.fs b/tests/FSharp.Test.Utilities/ScriptHelpers.fs index cb2956ab8ac..1822187751c 100644 --- a/tests/FSharp.Test.Utilities/ScriptHelpers.fs +++ b/tests/FSharp.Test.Utilities/ScriptHelpers.fs @@ -16,6 +16,7 @@ open FSharp.Test type LangVersion = | V80 | V90 + | V10 | Preview | Latest @@ -40,6 +41,7 @@ type FSharpScript(?additionalArgs: string[], ?quiet: bool, ?langVersion: LangVer | LangVersion.Latest -> "--langversion:latest" | LangVersion.V80 -> "--langversion:8.0" | LangVersion.V90 -> "--langversion:9.0" + | LangVersion.V10 -> "--langversion:10.0" |] let argv = Array.append baseArgs additionalArgs diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 10a99ee04ab..95491e2e593 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -66,11 +66,14 @@ module CoreTests = exec cfg cfg.DotNetExe ($"msbuild {projectFile} /p:Configuration={cfg.BUILD_CONFIG} -property:FSharpRepositoryPath={FSharpRepositoryPath}") #if !NETCOREAPP + // Pinned to 10.0: at 11.0 ErrorOnMissingSignatureAttribute turns FS3888 (attribute on impl but + // not signature) from warning into error, which this test deliberately exercises. 11.0 behavior is + // covered by Conformance/Signatures/SignatureEnforcedAttributes. [] - let ``attributes-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/attributes" FSC_OPTIMIZED + let ``attributes-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "core/attributes" FSC_OPTIMIZED "10.0" [] - let ``attributes-FSI`` () = singleTestBuildAndRun "core/attributes" FSI + let ``attributes-FSI`` () = singleTestBuildAndRunVersion "core/attributes" FSI "10.0" [] let span () =