From d7fb32c33b510dd44ba7a66cfa6a36cfe4b03097 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 23 Jun 2025 17:09:39 +0200 Subject: [PATCH 01/10] Move language features from preview to langversion 10 --- src/Compiler/Facilities/LanguageFeatures.fs | 36 +++++++++++-------- .../UseBindings/UseBangBindings.fs | 10 +++--- .../ActivePatternArgCountMismatchTest.fs | 2 +- .../ErrorMessages/TailCallAttribute.fs | 8 ++--- .../Interop/ByrefTests.fs | 16 ++++----- ...rnTypeDirectedPartialActivePatternTests.fs | 5 +-- .../Language/ComputationExpressionTests.fs | 8 ++--- .../ExperimentalAttributeCheckingTests.fs | 2 +- .../Nullness/NullableCsharpImportTests.fs | 2 +- .../SequenceExpressionTests.fs | 10 +++--- .../Signatures/SeqTests.fs | 2 +- .../Signatures/TypeTests.fs | 4 +-- tests/FSharp.Test.Utilities/Compiler.fs | 4 +++ 13 files changed, 60 insertions(+), 49 deletions(-) diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 246ec741d67..4df39e4fa15 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -115,10 +115,11 @@ type LanguageVersion(versionText) = static let languageVersion70 = 7.0m static let languageVersion80 = 8.0m static let languageVersion90 = 9.0m + static let languageVersion100 = 10.0m static let previewVersion = 9999m // Language version when preview specified - static let defaultVersion = languageVersion90 // Language version when default specified + static let defaultVersion = languageVersion100 // Language version when default specified static let latestVersion = defaultVersion // Language version when latest specified - static let latestMajorVersion = languageVersion90 // Language version when latestmajor specified + static let latestMajorVersion = languageVersion100 // Language version when latestmajor specified static let validOptions = [| "preview"; "default"; "latest"; "latestmajor" |] @@ -132,6 +133,7 @@ type LanguageVersion(versionText) = languageVersion70 languageVersion80 languageVersion90 + languageVersion100 |] static let features = @@ -222,21 +224,23 @@ type LanguageVersion(versionText) = LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, languageVersion90 LanguageFeature.EmptyBodiedComputationExpressions, languageVersion90 - // F# preview - LanguageFeature.EnforceAttributeTargets, previewVersion // Not enabled due to a number of external library dependencies on unenforced attributes - LanguageFeature.UseTypeSubsumptionCache, previewVersion + // F# 10.0 + LanguageFeature.EnforceAttributeTargets, languageVersion100 // Not enabled due to a number of external library dependencies on unenforced attributes + LanguageFeature.UseTypeSubsumptionCache, languageVersion100 + LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, languageVersion100 + LanguageFeature.AllowObjectExpressionWithoutOverrides, languageVersion100 + LanguageFeature.DontWarnOnUppercaseIdentifiersInBindingPatterns, languageVersion100 + LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, languageVersion100 + LanguageFeature.SupportValueOptionsAsOptionalParameters, languageVersion100 + LanguageFeature.WarnWhenUnitPassedToObjArg, languageVersion100 + LanguageFeature.UseBangBindingValueDiscard, languageVersion100 + LanguageFeature.BetterAnonymousRecordParsing, languageVersion100 + LanguageFeature.ScopedNowarn, languageVersion100 + LanguageFeature.AllowTypedLetOrUseBang, languageVersion100 + + // F# preview (still preview in 10.0) LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509 LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work - LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, previewVersion - LanguageFeature.AllowObjectExpressionWithoutOverrides, previewVersion - LanguageFeature.DontWarnOnUppercaseIdentifiersInBindingPatterns, previewVersion - LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, previewVersion - LanguageFeature.SupportValueOptionsAsOptionalParameters, previewVersion - LanguageFeature.WarnWhenUnitPassedToObjArg, previewVersion - LanguageFeature.UseBangBindingValueDiscard, previewVersion - LanguageFeature.BetterAnonymousRecordParsing, previewVersion - LanguageFeature.ScopedNowarn, previewVersion - LanguageFeature.AllowTypedLetOrUseBang, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -260,6 +264,8 @@ type LanguageVersion(versionText) = | "8" -> languageVersion80 | "9.0" | "9" -> languageVersion90 + | "10.0" + | "10" -> languageVersion100 | _ -> 0m let specified = getVersionFromString versionText diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs index 37c1447e89e..7127f563547 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs @@ -69,7 +69,7 @@ module UseBangBindingsPreview = let ``UseBangBindings - UseBang01_fs - Preview LangVersion`` compilation = compilation |> asExe - |> withLangVersionPreview + |> withLangVersion10 |> compileAndRun |> shouldSucceed @@ -77,7 +77,7 @@ module UseBangBindingsPreview = let ``UseBangBindings - UseBang02_fs - Preview LangVersion`` compilation = compilation |> asExe - |> withLangVersionPreview + |> withLangVersion10 |> compileAndRun |> shouldSucceed @@ -85,7 +85,7 @@ module UseBangBindingsPreview = let ``UseBangBindings - UseBang03_fs - Preview LangVersion`` compilation = compilation |> asExe - |> withLangVersionPreview + |> withLangVersion10 |> compileAndRun |> shouldSucceed @@ -93,7 +93,7 @@ module UseBangBindingsPreview = let ``UseBangBindings - UseBang04_fs - Preview LangVersion`` compilation = compilation |> asExe - |> withLangVersionPreview + |> withLangVersion10 |> compileAndRun |> shouldSucceed @@ -101,7 +101,7 @@ module UseBangBindingsPreview = let ``UseBangBindings - UseBang05_fs - Preview LangVersion`` compilation = compilation |> asExe - |> withLangVersionPreview + |> withLangVersion10 |> compileAndRun |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ActivePatternArgCountMismatchTest.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ActivePatternArgCountMismatchTest.fs index 09de043f4fd..60e1a5e98b7 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ActivePatternArgCountMismatchTest.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ActivePatternArgCountMismatchTest.fs @@ -546,7 +546,7 @@ let (|P|_|) (expr2 : int) (expr1 : int) = if expr1 = expr2 then ValueSome P else let expr2 = 2 match 1 with P expr2 -> () """ - |> withLangVersionPreview + |> withLangVersion10 |> withNoWarn IncompletePatternMatches |> typecheck |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs index 81ce04fc05a..e876eef0906 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs @@ -975,7 +975,7 @@ namespace N | Node branches -> branches |> List.collect loop """ |> FSharp - |> withLangVersionPreview + |> withLangVersion10 |> compile |> shouldFail |> withResults [ @@ -1437,7 +1437,7 @@ namespace N let someNonRecFun x = x + x """ |> FSharp - |> withLangVersionPreview + |> withLangVersion10 |> compile |> shouldFail |> withResults [ @@ -1461,7 +1461,7 @@ namespace N let someX = 23 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion10 |> compile |> shouldFail |> withDiagnostics [ @@ -1480,7 +1480,7 @@ namespace N let rec someRecLetBoundValue = nameof(someRecLetBoundValue) """ |> FSharp - |> withLangVersionPreview + |> withLangVersion10 |> compile |> shouldFail |> withSingleDiagnostic (Warning 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element") diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/ByrefTests.fs b/tests/FSharp.Compiler.ComponentTests/Interop/ByrefTests.fs index e5a278a4a85..487b7f6ee1a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/ByrefTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/ByrefTests.fs @@ -61,7 +61,7 @@ module ``Byref interop verification tests`` = open System let x(a:Action>) = a.Invoke(ReadOnlySpan([||])) """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed @@ -74,7 +74,7 @@ let x() = let a:(Action>) = Unchecked.defaultof<_> a """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed @@ -89,7 +89,7 @@ let main _args = with member x.CompareTo(o) = 42 } comparer.CompareTo(ReadOnlySpan([||])) """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed @@ -102,7 +102,7 @@ let processSeq (input:seq>) = for ros in input do printfn "%i" (ros.Length) """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed @@ -129,7 +129,7 @@ let main _args = 0 """ |> asExe - |> withLangVersionPreview + |> withLangVersion10 |> compileAndRun |> shouldSucceed |> verifyOutputContains [|": false";"x: true";"xyz: true"|] @@ -147,7 +147,7 @@ let main _args = let altLookup = myDict.GetAlternateLookup>() altLookup.ContainsKey(ReadOnlySpan([|'x'|])) """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed @@ -179,7 +179,7 @@ let main _args = 0 """ |> asExe - |> withLangVersionPreview + |> withLangVersion10 |> compileAndRun |> shouldSucceed |> verifyOutputContains [|"1";"System.Action`1[System.ReadOnlySpan`1[System.Int32]]"|] @@ -205,7 +205,7 @@ let processRecord (recd:MyRecordFullOfWrongStuff>>) = recd.MyDict.["x"] """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldFail |> withDiagnostics diff --git a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs index 8ae8d85db6e..382d3395abe 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs @@ -12,17 +12,18 @@ let fsiSession = getSessionForEval [||] LangVersion.Preview let runCode = evalInSharedSession fsiSession +// ...existing code... [] let ``Partial struct active pattern returns ValueOption`1 without []`` () = FSharp "let (|P1|_|) x = ValueNone" - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed [] let ``Partial struct active pattern returns bool`` () = FSharp "let (|P1|_|) x = false" - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index da918ffc00a..60e189587a5 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -122,7 +122,7 @@ let f3 () = return (new MyType() : IDisposable) } """ - |> withLangVersionPreview + |> withLangVersion10 |> asExe |> ignoreWarnings |> compileAndRun @@ -153,7 +153,7 @@ let f1() = return! (Ok 1 : Result) } """ - |> withLangVersionPreview + |> withLangVersion10 |> asExe |> ignoreWarnings |> compileAndRun @@ -231,8 +231,8 @@ let x = lb {1; 2; if true then 3;} |> ignore [] - [] - [] + [] + [] [] [] let ``A CE with BindReturn and Zero can omit else in an if-then return`` (langVersion, bindReturnName) = diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs index 653aa488281..937c9d3073e 100755 --- a/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs @@ -102,7 +102,7 @@ module TestModule = if getString = "A string" then () """ - |> withLangVersionPreview + |> withLangVersion10 |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs index bb67476cb9f..d969afc538f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs @@ -254,7 +254,7 @@ let theOtherOne = NullableClass.nullableImmArrayOfNotNullStrings |> asLibrary |> withReferences [csharpLib] |> withStrictNullness - |> withLangVersionPreview + |> withLangVersion10 |> compile |> shouldFail |> withDiagnostics diff --git a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs index 8490b41a750..6f80f090350 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs @@ -552,7 +552,7 @@ let b = [| { 1;10 } |] let c = [ { 1;10 } ] """ |> withOptions [ "--nowarn:0020" ] - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldFail |> withDiagnostics [ @@ -579,7 +579,7 @@ let c = [ { 1;10 } ] compilation |> getCompilation |> withOptions [ "--nowarn:0020" ] - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldFail |> withDiagnostics [ @@ -642,7 +642,7 @@ let c = [ { 1;10 } ] compilation |> getCompilation |> withOptions [ "--nowarn:0020" ] - |> withLangVersionPreview + |> withLangVersion10 |> typecheck |> shouldSucceed @@ -685,7 +685,7 @@ let f1() = yield (1 : int) } """ - |> withLangVersionPreview + |> withLangVersion10 |> asExe |> ignoreWarnings |> compileAndRun @@ -730,7 +730,7 @@ let f1() = yield! ([1;2] : int list) } """ - |> withLangVersionPreview + |> withLangVersion10 |> asExe |> ignoreWarnings |> compileAndRun diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs index fdca6035783..4e71a676efc 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs @@ -27,6 +27,6 @@ let transpose (source: seq<#seq<'T>>) = Fsi """module Program val transpose: source: seq<'Collection> -> seq> when 'Collection :> seq<'T>""" |> withAdditionalSourceFile encodeFs - |> withLangVersionPreview + |> withLangVersion10 |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/TypeTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/TypeTests.fs index f6b31e62d24..d025052b6fb 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/TypeTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/TypeTests.fs @@ -278,7 +278,7 @@ let bar = Bar 5 let f = bar.get_IsBar """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheckResults |> fun results -> let isBarSymbolUse = results.GetSymbolUseAtLocation(12, 21, "let f = bar.get_IsBar", [ "get_IsBar" ]).Value @@ -300,7 +300,7 @@ type Foo() = let foo = Foo() """ - |> withLangVersionPreview + |> withLangVersion10 |> typecheckResults |> fun results -> let isBarSymbolUse = results.GetSymbolUseAtLocation(7, 13, "let foo = Foo()", [ "Foo" ]).Value diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index e3c9269a5bd..d3ee5394866 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -621,9 +621,13 @@ module rec Compiler = let withLangVersion80 (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:8.0" ] "withLangVersion80 is only supported on F#" cUnit + let withLangVersion90 (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:9.0" ] "withLangVersion90 is only supported on F#" cUnit + let withLangVersion10 (cUnit: CompilationUnit) : CompilationUnit = + withOptionsHelper [ "--langversion:10.0" ] "withLangVersion10 is only supported on F#" cUnit + let withLangVersionPreview (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:preview" ] "withLangVersionPreview is only supported on F#" cUnit From b3897cc9612b36bed32cb564b9d0425e791911ff Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 23 Jun 2025 17:12:53 +0200 Subject: [PATCH 02/10] Update src/Compiler/Facilities/LanguageFeatures.fs --- 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 4df39e4fa15..a1c703975ed 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -225,7 +225,7 @@ type LanguageVersion(versionText) = LanguageFeature.EmptyBodiedComputationExpressions, languageVersion90 // F# 10.0 - LanguageFeature.EnforceAttributeTargets, languageVersion100 // Not enabled due to a number of external library dependencies on unenforced attributes + LanguageFeature.EnforceAttributeTargets, languageVersion100 LanguageFeature.UseTypeSubsumptionCache, languageVersion100 LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, languageVersion100 LanguageFeature.AllowObjectExpressionWithoutOverrides, languageVersion100 From 5e4eed112141d878bc2e085cfd19d64487cdf017 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 25 Jun 2025 13:00:13 +0200 Subject: [PATCH 03/10] Change langfeature warning messages in tests --- .../UseBindings/UseBangBindings.fs | 6 +-- .../Types/RecordTypes/AnonymousRecords.fs | 42 +++++++++---------- ...rnTypeDirectedPartialActivePatternTests.fs | 4 +- .../Language/ComputationExpressionTests.fs | 4 +- .../SequenceExpressionTests.fs | 4 +- .../WarnScopeTests.fs | 14 +++---- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs index 7127f563547..77ac4e5706f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs @@ -59,9 +59,9 @@ module UseBangBindingsVersion9 = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 43, Col 14, Line 43, Col 28, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 41, Col 14, Line 41, Col 28, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 40, Col 14, Line 40, Col 29, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 43, Col 14, Line 43, Col 28, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 41, Col 14, Line 41, Col 28, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 40, Col 14, Line 40, Col 29, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 10.0 or greater.") ] module UseBangBindingsPreview = diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index be7d0bf7ee0..4468c87fd36 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -37,8 +37,8 @@ module AnonRecd = |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 8, Col 20, Line 8, Col 23, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 9, Col 28, Line 9, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 8, Col 20, Line 8, Col 23, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 9, Col 28, Line 9, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -72,8 +72,8 @@ module AnonRecd = |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 4, Col 27, Line 4, Col 30, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 6, Col 28, Line 6, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 4, Col 27, Line 4, Col 30, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 6, Col 28, Line 6, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -103,8 +103,8 @@ module AnonRecd = |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 4, Col 35, Line 4, Col 38, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 6, Col 36, Line 6, Col 39, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 4, Col 35, Line 4, Col 38, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 6, Col 36, Line 6, Col 39, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -134,8 +134,8 @@ module AnonRecd = |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 4, Col 30, Line 4, Col 33, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 6, Col 31, Line 6, Col 34, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 4, Col 30, Line 4, Col 33, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 6, Col 31, Line 6, Col 34, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -605,11 +605,11 @@ let (@>=) = (@) |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 5, Col 48, Line 5, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 6, Col 80, Line 6, Col 82, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 7, Col 80, Line 7, Col 82, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 10, Col 47, Line 10, Col 48, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 12, Col 48, Line 12, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 5, Col 48, Line 5, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 6, Col 80, Line 6, Col 82, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 7, Col 80, Line 7, Col 82, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 10, Col 47, Line 10, Col 48, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 12, Col 48, Line 12, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] @@ -632,11 +632,11 @@ let expr8 : {| A: Expr |} = {| A = <@@ 1 + 1 @@>|} |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 5, Col 44, Line 5, Col 45, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 6, Col 70, Line 6, Col 72, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 7, Col 70, Line 7, Col 72, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 10, Col 43, Line 10, Col 44, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 12, Col 44, Line 12, Col 45, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 5, Col 44, Line 5, Col 45, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 6, Col 70, Line 6, Col 72, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 7, Col 70, Line 7, Col 72, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 10, Col 43, Line 10, Col 44, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 12, Col 44, Line 12, Col 45, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -654,7 +654,7 @@ let expr2 : {| A: Expr; B: Expr; C: string |} = |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 5, Col 50, Line 5, Col 55, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 5, Col 50, Line 5, Col 55, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -672,8 +672,8 @@ let nested2 : {| A: {| B: Expr |}; C: Expr |} = |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 5, Col 34, Line 5, Col 35, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 5, Col 61, Line 5, Col 66, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 5, Col 34, Line 5, Col 35, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 5, Col 61, Line 5, Col 66, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") (Error 3350, Line 8, Col 22, Line 8, Col 24, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") (Error 3350, Line 8, Col 44, Line 8, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs index 382d3395abe..1f558fa6749 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs @@ -70,8 +70,8 @@ let (|OddVOption|_|) x = if x % 2 = 1 then ValueSome() else ValueNone |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 1, Col 6, Line 1, Col 17, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.") - (Error 3350, Line 2, Col 6, Line 2, Col 20, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.") + (Error 3350, Line 1, Col 6, Line 1, Col 17, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 10.0 or greater.") + (Error 3350, Line 2, Col 6, Line 2, Col 20, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 10.0 or greater.") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index 60e189587a5..b9dc7b2b76d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -57,7 +57,7 @@ let f3 () = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 11, Col 16, Line 11, Col 42, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 11, Col 16, Line 11, Col 42, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -89,7 +89,7 @@ let f1() = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 16, Col 17, Line 16, Col 43, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 16, Col 17, Line 16, Col 43, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs index 6f80f090350..b454f291601 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs @@ -666,7 +666,7 @@ let f1() = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 7, Col 15, Line 7, Col 22, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 7, Col 15, Line 7, Col 22, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] @@ -711,7 +711,7 @@ let f1() = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 7, Col 16, Line 7, Col 32, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 7, Col 16, Line 7, Col 32, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 10.0 or greater.") ] [] diff --git a/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs b/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs index 6348fa560ff..b55cca7fab3 100644 --- a/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs @@ -68,7 +68,7 @@ module N.M "" "" () -"""; errors = Map["9.0", [Warn(20, 3)]; "preview", [Warn(20, 3)]]} +"""; errors = Map["9.0", [Warn(20, 3)]; "10.0", [Warn(20, 3)]]} let private noNowarnTest = {source = """ module N.M @@ -79,7 +79,7 @@ module N.M () """; errors = Map[ "9.0", [Warn(20, 3); Warn(20, 4); Warn(20, 5); Warn(20, 6)] - "preview", [Warn(20, 3); Warn(20, 4); Warn(20, 5); Warn(20, 6) + "10.0", [Warn(20, 3); Warn(20, 4); Warn(20, 5); Warn(20, 6) ]]} let private onOffTest = {source = """ @@ -92,7 +92,7 @@ module N.M #nowarn "20" "" () -"""; errors = Map["9.0", [Err(3350, 6); Warn(20, 3)]; "preview", [Warn(20, 3); Warn(20, 7)]]} +"""; errors = Map["9.0", [Err(3350, 6); Warn(20, 3)]; "10.0", [Warn(20, 3); Warn(20, 7)]]} let mkProjectOptionsAndChecker langVersion = let options = createProjectOptions [onOffTest.source] [$"--langversion:{langVersion}"] @@ -116,7 +116,7 @@ let private checkDiagnostics (expected: Expected list) (diagnostics: FSharpDiagn elif List.exists unexpected (List.zip expected diagnostics) then fail() [] -[] +[] [] let ParseAndCheckProjectTest langVersion = let options, checker = mkProjectOptionsAndChecker langVersion @@ -124,7 +124,7 @@ let ParseAndCheckProjectTest langVersion = checkDiagnostics onOffTest.errors[langVersion] (Array.toList wholeProjectResults.Diagnostics) [] -[] +[] [] let ParseAndCheckFileInProjectTest langVersion = let options, checker = mkProjectOptionsAndChecker langVersion @@ -139,7 +139,7 @@ let ParseAndCheckFileInProjectTest langVersion = [justNowarnTest; noNowarnTest; onOffTest] |> List.iter parseAndCheckFileInProject [] -[] +[] [] let CheckFileInProjectTest langVersion = let projectOptions, checker = mkProjectOptionsAndChecker langVersion @@ -156,7 +156,7 @@ let CheckFileInProjectTest langVersion = [justNowarnTest; noNowarnTest; onOffTest] |> List.iter checkFileInProject [] -[] +[] [] let GetBackgroundCheckResultsForFileInProjectTest langVersion = let options, checker = mkProjectOptionsAndChecker langVersion From e77b4d5cd7a06e6c1e1f8a6501eed7f7367dd332 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 26 Jun 2025 10:57:47 +0200 Subject: [PATCH 04/10] Update LanguageFeatures.fs --- src/Compiler/Facilities/LanguageFeatures.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index a1c703975ed..765cd52f363 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -227,7 +227,7 @@ type LanguageVersion(versionText) = // F# 10.0 LanguageFeature.EnforceAttributeTargets, languageVersion100 LanguageFeature.UseTypeSubsumptionCache, languageVersion100 - LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, languageVersion100 + LanguageFeature.AllowObjectExpressionWithoutOverrides, languageVersion100 LanguageFeature.DontWarnOnUppercaseIdentifiersInBindingPatterns, languageVersion100 LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, languageVersion100 @@ -241,6 +241,7 @@ type LanguageVersion(versionText) = // F# preview (still preview in 10.0) LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509 LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work + LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, languageVersion100 // Stopped printing arguments to indexed properties ] static let defaultLanguageVersion = LanguageVersion("default") From c3f8f213ce26411335586cfb166b6c18dfdd0a47 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 26 Jun 2025 15:05:23 +0200 Subject: [PATCH 05/10] adjust tests. descope AllowAccessModifiersToAutoPropertiesGettersAndSetters and do separately --- src/Compiler/Facilities/LanguageFeatures.fs | 2 +- start-vs-FsharpSln.cmd | 44 +++++++++++++++++++ .../CompilerDirectives/Nowarn.fs | 4 +- .../CompilerOptions/fsc/flaterrors.fs | 2 + .../BindingExpressions/BindingExpressions.fs | 8 ++-- .../HighPrecedenceApplication.fs | 1 + .../PatternMatching/Union/Union.fs | 26 +++++------ .../Types/RecordTypes/AnonymousRecords.fs | 18 +++++--- .../ErrorMessages/TypeMismatchTests.fs | 2 +- ...rnTypeDirectedPartialActivePatternTests.fs | 4 +- .../ExperimentalAttributeCheckingTests.fs | 2 +- 11 files changed, 82 insertions(+), 31 deletions(-) create mode 100644 start-vs-FsharpSln.cmd diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 765cd52f363..1ed35b2f3d5 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -241,7 +241,7 @@ type LanguageVersion(versionText) = // F# preview (still preview in 10.0) LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509 LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work - LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, languageVersion100 // Stopped printing arguments to indexed properties + LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, previewVersion // Stopped printing arguments to indexed properties ] static let defaultLanguageVersion = LanguageVersion("default") diff --git a/start-vs-FsharpSln.cmd b/start-vs-FsharpSln.cmd new file mode 100644 index 00000000000..8dc2074cd47 --- /dev/null +++ b/start-vs-FsharpSln.cmd @@ -0,0 +1,44 @@ +@echo off +setlocal enabledelayedexpansion + +:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK. + +:: This tells .NET Core to use the same dotnet.exe that build scripts use +set DOTNET_ROOT=%~dp0.dotnet +set DOTNET_ROOT(x86)=%~dp0.dotnet\x86 + +:: This tells .NET Core not to go looking for .NET Core in other places +set DOTNET_MULTILEVEL_LOOKUP=0 + +:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use +set PATH=%DOTNET_ROOT%;%PATH% + +call restore.cmd + +if not exist "%DOTNET_ROOT%\dotnet.exe" ( + echo [ERROR] .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools + exit /b 1 +) + +:: These tasks aren't running successfully when launching VS, skipping when launching via this batch file +set RunNetFrameworkApiCompat=false +set RunRefApiCompat=false + +:: Prefer the VS in the developer command prompt if we're in one, followed by whatever shows up in the current search path. +set "DEVENV=%DevEnvDir%devenv.exe" + +if exist "%DEVENV%" ( + :: Fully qualified works + set "COMMAND=start "" /B "%ComSpec%" /S /C ""%DEVENV%" "%~dp0FSharp.sln""" +) else ( + where devenv.exe /Q + if !errorlevel! equ 0 ( + :: On the PATH, use that. + set "COMMAND=start "" /B "%ComSpec%" /S /C "devenv.exe "%~dp0FSharp.sln""" + ) else ( + :: Can't find devenv.exe, let file associations take care of it + set "COMMAND=start /B .\FSharp.sln" + ) +) + +%COMMAND% \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs index dfbb6d3a735..c4f377f8c2e 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs @@ -179,6 +179,6 @@ let a = 1; #nowarn 20 |> compile |> withDiagnostics [ Error 3874, Line 4, Col 11, Line 4, Col 22, "#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" - Warning 203, Line 3, Col 9, Line 3, Col 11, "Invalid warning number 'xy'" - Warning 203, Line 3, Col 12, Line 3, Col 17, "Invalid warning number 'abx'" + Error 203, Line 3, Col 9, Line 3, Col 11, "Invalid warning number 'xy'" + Error 203, Line 3, Col 12, Line 3, Col 17, "Invalid warning number 'abx'" ] diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs index 592b3ac09ee..6ea2a0ca156 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs @@ -26,6 +26,7 @@ module flaterrors = |> compile options |> shouldFail |> withDiagnostics [ + (Warning 3873, Line 1, Col 10, Line 1, Col 17, "This construct is deprecated. Sequence expressions should be of the form 'seq { ... }'") (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\n ''a list' \nbut here has type\n ''b seq' ") (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\n ''a list' \nbut here has type\n 'int seq' ") (Warning 20, Line 1, Col 1, Line 1, Col 17, "The result of this expression has type ''a list' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.") @@ -40,6 +41,7 @@ module flaterrors = |> compile options |> shouldFail |> withDiagnostics [ + (Warning 3873, Line 1, Col 10, Line 1, Col 17, "This construct is deprecated. Sequence expressions should be of the form 'seq { ... }'") (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\029 ''a list' \029but here has type\029 ''b seq'") (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\029 ''a list' \029but here has type\029 'int seq'") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs index f3f3d9d9d34..017e5b8a61f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs @@ -159,11 +159,12 @@ module BindingExpressions = ] [] - let ``UpperBindingPattern_fs`` compilation = + let ``UpperBindingPattern_fs v9`` compilation = compilation |> getCompilation |> asExe |> withOptions ["--test:ErrorRanges"] + |> withLangVersion90 |> typecheck |> shouldFail |> withDiagnostics [ @@ -191,11 +192,10 @@ module BindingExpressions = ] [] - let ``UpperBindingPattern_fs preview`` compilation = + let ``UpperBindingPattern_fs`` compilation = compilation |> getCompilation - |> asExe - |> withLangVersionPreview + |> asExe |> withOptions ["--test:ErrorRanges"] |> typecheck |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/HighPrecedenceApplication/HighPrecedenceApplication.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/HighPrecedenceApplication/HighPrecedenceApplication.fs index 4ec5b1b53d1..f1d46256a5d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/HighPrecedenceApplication/HighPrecedenceApplication.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/HighPrecedenceApplication/HighPrecedenceApplication.fs @@ -16,6 +16,7 @@ module HighPrecedenceApplication = |> getCompilation |> asFs |> withOptions ["-a"] + |> withNoWarn 3873 // This construct is deprecated. Sequence expressions should be of the form 'seq { ... } |> compile |> shouldSucceed |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs index 88e98b14542..e4ea72c26a9 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs @@ -218,19 +218,19 @@ but here has type |> withOptions ["--test:ErrorRanges"; "--nowarn:026"] |> typecheck |> shouldFail - |> withDiagnostics [ - (Warning 49, Line 15, Col 7, Line 15, Col 10, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 16, Col 7, Line 16, Col 10, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 20, Col 7, Line 20, Col 10, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 24, Col 3, Line 24, Col 6, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 35, Col 14, Line 35, Col 17, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 41, Col 12, Line 41, Col 15, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 45, Col 20, Line 45, Col 23, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 50, Col 14, Line 50, Col 17, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 50, Col 21, Line 50, Col 24, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 51, Col 14, Line 51, Col 17, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - (Warning 49, Line 52, Col 14, Line 52, Col 17, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.") - ] + |> withDiagnostics + [(Warning 49, Line 3, Col 7, Line 3, Col 9, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 4, Col 7, Line 4, Col 9, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 5, Col 7, Line 5, Col 8, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 9, Col 7, Line 9, Col 9, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 10, Col 7, Line 10, Col 9, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 11, Col 7, Line 11, Col 8, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 15, Col 7, Line 15, Col 10, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 16, Col 7, Line 16, Col 10, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 20, Col 7, Line 20, Col 10, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 24, Col 3, Line 24, Col 6, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 28, Col 3, Line 28, Col 5, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name."); + (Warning 49, Line 35, Col 14, Line 35, Col 17, "Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.")] [] let ``Union - UpperUnionCasePattern_fs preview - --test:ErrorRanges`` compilation = diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index 4468c87fd36..24603444766 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -21,7 +21,7 @@ module AnonRecd = |> withMessage "The field 'A' appears multiple times in this record expression." [] - let ``Anonymous Record with unit of measures`` () = + let ``Anonymous Record with unit of measures v9`` () = FSharp """ namespace FSharpTest @@ -34,6 +34,7 @@ module AnonRecd = let c = {|a=1 |} let d = {| a=1; b=2; c=3 |} """ + |> withLangVersion90 |> compile |> shouldFail |> withDiagnostics [ @@ -60,7 +61,7 @@ module AnonRecd = |> shouldSucceed [] - let ``Anonymous Record with typeof`` () = + let ``Anonymous Record with typeof -v9`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -69,6 +70,7 @@ module AnonRecd = let c = {| a=typeof|} let d = {| a=typeof |} """ + |> withLangVersion90 |> compile |> shouldFail |> withDiagnostics [ @@ -91,7 +93,7 @@ module AnonRecd = |> shouldSucceed [] - let ``Anonymous Record with typedefof`` () = + let ``Anonymous Record with typedefof -v9`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -100,6 +102,7 @@ module AnonRecd = let c = {| a=typedefof<_ option>|} let d = {| a=typedefof<_ option> |} """ + |> withLangVersion90 |> compile |> shouldFail |> withDiagnostics [ @@ -122,7 +125,7 @@ module AnonRecd = |> shouldSucceed [] - let ``Anonymous Record with nameof`` () = + let ``Anonymous Record with nameof -v9`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -131,6 +134,7 @@ module AnonRecd = let c<'T> = {| a=nameof<'T>|} let d<'T> = {| a=nameof<'T> |} """ + |> withLangVersion90 |> compile |> shouldFail |> withDiagnostics [ @@ -658,7 +662,7 @@ let expr2 : {| A: Expr; B: Expr; C: string |} = ] [] - let ``Version 9: Nested anonymous records with quotations should parse correctly``() = + let ``Version 9: Nested anonymous records with quotations should parse correctly v9``() = Fsx """ open Microsoft.FSharp.Quotations @@ -674,6 +678,6 @@ let nested2 : {| A: {| B: Expr |}; C: Expr |} = |> withDiagnostics [ (Error 3350, Line 5, Col 34, Line 5, Col 35, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") (Error 3350, Line 5, Col 61, Line 5, Col 66, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") - (Error 3350, Line 8, Col 22, Line 8, Col 24, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 8, Col 44, Line 8, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 8, Col 22, Line 8, Col 24, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") + (Error 3350, Line 8, Col 44, Line 8, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 10.0 or greater.") ] diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs index 53cb33b5b78..955ea8e9d47 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs @@ -360,7 +360,7 @@ let foo items = [] let main args = - foo ({1..10} |> Seq.pairwise) + foo (seq {1..10} |> Seq.pairwise) 0 """ |> asExe diff --git a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs index 1f558fa6749..382d3395abe 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs @@ -70,8 +70,8 @@ let (|OddVOption|_|) x = if x % 2 = 1 then ValueSome() else ValueNone |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 1, Col 6, Line 1, Col 17, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 10.0 or greater.") - (Error 3350, Line 2, Col 6, Line 2, Col 20, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 10.0 or greater.") + (Error 3350, Line 1, Col 6, Line 1, Col 17, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.") + (Error 3350, Line 2, Col 6, Line 2, Col 20, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs index 937c9d3073e..653aa488281 100755 --- a/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ExperimentalAttributeCheckingTests.fs @@ -102,7 +102,7 @@ module TestModule = if getString = "A string" then () """ - |> withLangVersion10 + |> withLangVersionPreview |> compile |> shouldSucceed From 9d4d4da65d2c902f248f0b5b7fb5a739f551f601 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 26 Jun 2025 22:27:14 +0200 Subject: [PATCH 06/10] Reducing usage of withLangVersionPreview and adjust tests --- .../CompilerDirectives/Nowarn.fs | 2 +- .../AttributeUsage/AttributeUsage.fs | 16 ------------- .../CustomAttributes/Basic/Basic.fs | 3 --- .../DelegateTypes/DelegateDefinition.fs | 1 - .../OptionalArguments/OptionalArguments.fs | 18 +++----------- .../OptionalDefaultParamArgs.fs | 2 -- .../ComputationExpressions.fs | 3 +-- .../ObjectExpressions/ObjectExpressions.fs | 15 ------------ .../PatternMatching/Simple/Simple.fs | 1 - .../PatternMatching/Union/Union.fs | 1 - .../Types/RecordTypes/AnonymousRecords.fs | 24 +++++++------------ .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 2 -- .../Types/UnionTypes/UnionStructTypes.fs | 1 - .../ClassTypeVisibilityModuleRootWithFsi.fs | 1 - .../RealInternalSignature.fs | 2 -- .../ErrorMessages/TypeMismatchTests.fs | 2 +- 16 files changed, 14 insertions(+), 80 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs index c4f377f8c2e..4eeccde4602 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs @@ -16,7 +16,7 @@ module Nowarn = let private make20 = "1" let private make25 = "match None with None -> ()" let private W20 = Warning 20 - let private vp = "PREVIEW" + let private vp = "LATEST" let private v9 = "9.0" let private fs = String.concat Environment.NewLine >> FsSource let private fsMod lines = fs ("module A" :: lines) 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 a2ee105f91c..70d72f94855 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs @@ -79,7 +79,6 @@ module CustomAttributes_AttributeUsage = [] let ``Preview: AttributeTargetsIsMethod01_fs opt-in warning`` compilation = compilation - |> withLangVersionPreview |> withWarnOn 3878 |> verifyCompileAndRun |> shouldSucceed @@ -110,7 +109,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargets01_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -147,7 +145,6 @@ module CustomAttributes_AttributeUsage = let ``E_AttributeTargetIsField01_fs`` compilation = compilation |> withOptions ["--nowarn:25"] - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -200,7 +197,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsMethod02_fs`` compilation = compilation - |> withLangVersionPreview |> withOptions ["--nowarn:25"] |> verifyCompile |> shouldFail @@ -231,7 +227,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsMethod03_fs`` compilation = compilation - |> withLangVersionPreview |> withOptions ["--nowarn:25"] |> verifyCompile |> shouldFail @@ -349,7 +344,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsStruct_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -379,7 +373,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsClass_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -400,7 +393,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsClass01_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -510,7 +502,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsField03_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -521,7 +512,6 @@ module CustomAttributes_AttributeUsage = [] let ``Preview: E_AttributeTargetIsField03_fs opt-in warning`` compilation = compilation - |> withLangVersionPreview |> withWarnOn 3878 |> verifyCompile |> shouldFail @@ -543,7 +533,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsProperty01_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldSucceed @@ -559,7 +548,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsCtor01_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -596,7 +584,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsEnum01_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -633,7 +620,6 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetsIsDelegate01_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -682,7 +668,6 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = [] let ``E_AttributeTargetIsInterface_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -704,7 +689,6 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = [] let ``E_AttributeTargetIsClass02_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs index 44ee388af9d..6bb4761f7be 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs @@ -160,7 +160,6 @@ module CustomAttributes_Basic = [] let ``E_StructLayoutSequentialNeg_DU2_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -171,7 +170,6 @@ module CustomAttributes_Basic = [] let ``E_StructLayoutSequentialNeg_Delegate_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -182,7 +180,6 @@ module CustomAttributes_Basic = [] let ``E_StructLayoutSequentialNeg_Interface_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs index 1f4462fa6d3..2fa6373a92c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs @@ -64,7 +64,6 @@ a.Invoke()""" let f = fun (a: int voption) -> defaultValueArg a 100 |> printf "line: %d" let a = A f a.Invoke(5)""" - |> withLangVersionPreview |> compileExeAndRun |> shouldSucceed |> verifyOutput "line: 5" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs index 4d0843014e0..508314ee941 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs @@ -170,7 +170,6 @@ let main _ = """ source |> asExe - |> withLangVersionPreview |> withNoWarn 25 |> compile |> shouldSucceed @@ -199,7 +198,6 @@ let main _ = """ source |> asExe - |> withLangVersionPreview |> withNoWarn 25 |> compile |> shouldSucceed @@ -228,7 +226,6 @@ let main _ = """ source |> asExe - |> withLangVersionPreview |> withNoWarn 25 |> compile |> shouldSucceed @@ -257,7 +254,6 @@ let main _ = """ source |> asExe - |> withLangVersionPreview |> withNoWarn 25 |> compile |> shouldSucceed @@ -267,7 +263,7 @@ let main _ = [] - let ``Optional Arguments can be a ValueOption+StructAttribute attribute with langversion=preview`` () = + let ``Optional Arguments can be a ValueOption+StructAttribute attribute`` () = let source = FSharp """ module Program @@ -287,7 +283,6 @@ let main _ = """ let compilation = source - |> withLangVersionPreview |> asExe |> compile @@ -343,7 +338,7 @@ let main _ = [] - let ``Optional Arguments can be a ValueOption+Struct attribute with langversion=preview`` () = + let ``Optional Arguments can be a ValueOption+Struct attribute`` () = let source = FSharp """ module Program @@ -363,7 +358,6 @@ let main _ = """ let compilation = source - |> withLangVersionPreview |> asExe |> compile @@ -438,7 +432,6 @@ let main _ = """ let compilation = source - |> withLangVersionPreview |> asExe |> compile @@ -469,7 +462,6 @@ let main _ = """ let compilation = source - |> withLangVersionPreview |> asExe |> compile @@ -500,7 +492,6 @@ let main _ = """ let compilation = source - |> withLangVersionPreview |> asExe |> compile @@ -531,7 +522,6 @@ let main _ = """ let compilation = source - |> withLangVersionPreview |> asExe |> compile @@ -542,7 +532,7 @@ let main _ = |> withOutputContainsAllInOrder ["VSome ValueSome 1"; "VSome ValueNone"; "VSome 1"; "VNone"] [] - let ``Optional Arguments in constructor can be a ValueOption+StructAttribute attribute with langversion=preview`` () = + let ``Optional Arguments in constructor can be a ValueOption+StructAttribute attribute`` () = let source = FSharp """ module Program @@ -562,7 +552,6 @@ let main _ = """ let compilation = source - |> withLangVersionPreview |> asExe |> compile @@ -639,7 +628,6 @@ let main _args = source |> FSharp - |> withLangVersionPreview |> withNoWarn 25 |> asExe |> compile diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalDefaultParamArgs/OptionalDefaultParamArgs.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalDefaultParamArgs/OptionalDefaultParamArgs.fs index 8ba293dce2a..3c41d7d6534 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalDefaultParamArgs/OptionalDefaultParamArgs.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalDefaultParamArgs/OptionalDefaultParamArgs.fs @@ -73,7 +73,6 @@ module MemberDefinitions_OptionalDefaultParamArgs = [] let ``W_WrongDefaultType_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics @@ -86,7 +85,6 @@ module MemberDefinitions_OptionalDefaultParamArgs = [] let ``W_WrongDefaultObjType_fs`` compilation = compilation - |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ComputationExpressions/ComputationExpressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ComputationExpressions/ComputationExpressions.fs index 2738c701134..8e340726963 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ComputationExpressions/ComputationExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ComputationExpressions/ComputationExpressions.fs @@ -151,8 +151,7 @@ module EmptyBodied = /// F# 9.0 and above support empty-bodied computation expressions. module Supported = /// The language version that supports empty-bodied computation expressions. - /// TODO: Update this to the appropriate version when the feature comes out of preview. - let [] SupportedLanguageVersion = "preview" + let [] SupportedLanguageVersion = "latest" [] let ``seq { } ≡ seq { () }`` () = diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs index 45e97d5748c..7838300082a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs @@ -759,7 +759,6 @@ type Class() = class end let implementer = { new Class() } """ - |> withLangVersionPreview |> typecheck |> shouldSucceed @@ -771,7 +770,6 @@ type Class() = let implementer = { new Class() } """ - |> withLangVersionPreview |> typecheck |> shouldSucceed @@ -783,7 +781,6 @@ type IFirst = let x = { new _ with member this.MyMember() = 42 } """ - |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ @@ -806,7 +803,6 @@ type MyClass() = let expr = { new MyClass() } (expr:> ISecond).M() """ - |> withLangVersionPreview |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ @@ -820,7 +816,6 @@ type IFirst = interface end let implementer() ={ new IFirst } """ - |> withLangVersionPreview |> typecheck |> shouldSucceed @@ -834,7 +829,6 @@ type AbstractClass() = let res = { new AbstractClass() } """ - |> withLangVersionPreview |> typecheck |> shouldSucceed @@ -849,7 +843,6 @@ type AbstractClass() = let res = { new AbstractClass() with override this.ToString() = "ConcreteMethod" } """ - |> withLangVersionPreview |> typecheck |> shouldSucceed @@ -862,7 +855,6 @@ type AbstractClass() = let res = { new AbstractClass() } """ - |> withLangVersionPreview |> compileExeAndRun |> withStdOutContainsAllInOrder [ "AbstractClass constructor" @@ -878,7 +870,6 @@ type AbstractClass() = let res = { new AbstractClass() } """ - |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ @@ -895,7 +886,6 @@ let foo = { new Foo() } let foo2 = { new Foo() with member __.ToString() = base.ToString() } """ - |> withLangVersionPreview |> typecheck |> shouldSucceed @@ -912,7 +902,6 @@ type MyClass() = class end interface IFirst } |> ignore """ - |> withLangVersionPreview |> typecheck |> shouldSucceed @@ -926,7 +915,6 @@ let foo = { new Foo() } let foo1 = new Foo() """ - |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ @@ -947,7 +935,6 @@ type MyClass() = let res = { new MyClass() } """ - |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ @@ -982,7 +969,6 @@ open CSLib let res = { new Animal() } """ - |> withLangVersionPreview |> withName "FSLib" |> withReferences [ csharp ] @@ -1020,7 +1006,6 @@ open CSLib let res = { new Animal() } """ - |> withLangVersionPreview |> withName "FSLib" |> withReferences [ csharp ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple/Simple.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple/Simple.fs index 8b556d25cfa..12a14060c2c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple/Simple.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple/Simple.fs @@ -53,7 +53,6 @@ module Simple = let ``Simple - W_BindCapitalIdent_fs preview - --test:ErrorRanges`` compilation = compilation |> getCompilation - |> withLangVersionPreview |> asFsx |> withOptions ["--test:ErrorRanges"] |> compile diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs index e4ea72c26a9..6aec715af30 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs @@ -235,7 +235,6 @@ but here has type [] let ``Union - UpperUnionCasePattern_fs preview - --test:ErrorRanges`` compilation = compilation - |> withLangVersionPreview |> asFs |> withOptions ["--test:ErrorRanges"; "--nowarn:026"] |> typecheck diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index 24603444766..69c14a8d418 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -43,7 +43,7 @@ module AnonRecd = ] [] - let ``Preview : Anonymous Record with unit of measures`` () = + let ``Anonymous Record with unit of measures`` () = FSharp """ namespace FSharpTest @@ -56,7 +56,6 @@ module AnonRecd = let c = {|a=1 |} let d = {| a=1; b=2; c=3 |} """ - |> withLangVersionPreview |> compile |> shouldSucceed @@ -79,7 +78,7 @@ module AnonRecd = ] [] - let ``Preview: Anonymous Record with typeof`` () = + let ``Anonymous Record with typeof`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -88,7 +87,6 @@ module AnonRecd = let c = {| a=typeof|} let d = {| a=typeof |} """ - |> withLangVersionPreview |> compile |> shouldSucceed @@ -111,7 +109,7 @@ module AnonRecd = ] [] - let ``Preview: Anonymous Record with typedefof`` () = + let ``Anonymous Record with typedefof`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -120,7 +118,6 @@ module AnonRecd = let c = {| a=typedefof<_ option>|} let d = {| a=typedefof<_ option> |} """ - |> withLangVersionPreview |> compile |> shouldSucceed @@ -143,7 +140,7 @@ module AnonRecd = ] [] - let ``Preview: Anonymous Record with nameof`` () = + let ``Anonymous Record with nameof`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -152,7 +149,6 @@ module AnonRecd = let c<'T> = {| a=nameof<'T>|} let d<'T> = {| a=nameof<'T> |} """ - |> withLangVersionPreview |> compile |> shouldSucceed @@ -513,7 +509,7 @@ let v = {| ``A`` = 0; B = 5; A = ""; B = 0 |} ] [] - let ``Preview: Anonymous records with typed quotations should parse correctly``() = + let ``Anonymous records with typed quotations should parse correctly``() = Fsx """ open Microsoft.FSharp.Quotations @@ -532,12 +528,11 @@ let (@>=) = (@) [1..2] =<@ [3..4] @>= [5..6] """ - |> withLangVersionPreview |> compile |> shouldSucceed [] - let ``Preview: Anonymous records with untyped quotations should parse correctly``() = + let ``Anonymous records with untyped quotations should parse correctly``() = Fsx """ open Microsoft.FSharp.Quotations @@ -551,12 +546,11 @@ let expr6 : {| A: Expr |} = {| A= <@@ 1 + 1 @@>|} let expr7 : {| A: Expr |} = {| A = <@@ 1 + 1 @@> |} let expr8 : {| A: Expr |} = {| A = <@@ 1 + 1 @@>|} """ - |> withLangVersionPreview |> compile |> shouldSucceed [] - let ``Preview: Anonymous records with mixed quotations should parse correctly``() = + let ``Anonymous records with mixed quotations should parse correctly``() = Fsx """ open Microsoft.FSharp.Quotations @@ -566,12 +560,11 @@ let expr : {| Typed: Expr; Untyped: Expr |} = let expr2 : {| A: Expr; B: Expr; C: string |} = {| A = <@ 42 @>; B = <@@ true @@>; C = "normal string"|} """ - |> withLangVersionPreview |> compile |> shouldSucceed [] - let ``Preview: Nested anonymous records with quotations should parse correctly``() = + let ``Nested anonymous records with quotations should parse correctly``() = Fsx """ open Microsoft.FSharp.Quotations @@ -581,7 +574,6 @@ let nested = let nested2 : {| A: {| B: Expr |}; C: Expr |} = {| A = {| B = <@ 42 @>|}; C = <@@ true @@>|} """ - |> withLangVersionPreview |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index bfa44185a1c..30256560262 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -74,7 +74,6 @@ let main _ = let ``IWSAM test files`` compilation = compilation |> setupCompilation false - |> withLangVersionPreview |> compileAndRun |> shouldSucceed @@ -1400,7 +1399,6 @@ let inline length2 (x: ^a when ^a: (member Length: int with public get)) = x.Len let inline length3 (x: ^a when ^a: (member Length: int with public set)) = x.set_Length(1) let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() """ - |> withLangVersionPreview |> withRealInternalSignature realsig |> typecheck |> shouldFail diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs index 0ec6dc99632..18637179b2a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs @@ -771,7 +771,6 @@ type Foo = let foo = [Baz 42; Bat; Batman] printf "%A" foo""" - |> withLangVersionPreview |> asExe |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs index 8dc1184ea3a..ba40e165155 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs @@ -860,7 +860,6 @@ type TestType () = static member DefaultMethod() = () static member HiddenMethod() = ()""")) |> asLibrary - |> withLangVersionPreview |> withRealInternalSignature realSig |> compile |> withILContains [ diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/RealInternalSignature.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/RealInternalSignature.fs index 2f03e5de0e3..436072744e6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/RealInternalSignature.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/RealInternalSignature.fs @@ -1253,7 +1253,6 @@ module M = let res = C("http://www.myserver.com") 0 """ - |> withLangVersionPreview |> withRealInternalSignature true |> asLibrary |> compile @@ -1281,7 +1280,6 @@ module M = let res = C("http://www.myserver.com") 0 """ - |> withLangVersionPreview |> withRealInternalSignature false |> asLibrary |> compile diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs index 955ea8e9d47..d645f4d5a92 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs @@ -367,6 +367,6 @@ let main args = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 1, Line 8, Col 21, Line 8, Col 33, "The tuples have differing lengths of 3 and 2") + (Error 1, Line 8, Col 25, Line 8, Col 37, "The tuples have differing lengths of 3 and 2") ] From 32a45fdbdb3399b60357905199e6eb780df5c45b Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 27 Jun 2025 13:12:28 +0200 Subject: [PATCH 07/10] adjust tests --- src/Compiler/Facilities/LanguageFeatures.fs | 2 +- .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 2 ++ .../fsi/langversion/langversionhelp.437.1033.bsl | 3 ++- .../QueryExpressions/W_UppercaseIdentifier01.fs | 14 -------------- .../QueryExpressions/W_UppercaseIdentifier02.fs | 13 ------------- .../QueryExpressions/W_UppercaseIdentifier03.fs | 14 -------------- .../DataExpressions/QueryExpressions/env.lst | 3 --- 7 files changed, 5 insertions(+), 46 deletions(-) delete mode 100644 tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier01.fs delete mode 100644 tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier02.fs delete mode 100644 tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier03.fs diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 1ed35b2f3d5..a69b9dae123 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -227,7 +227,7 @@ type LanguageVersion(versionText) = // F# 10.0 LanguageFeature.EnforceAttributeTargets, languageVersion100 LanguageFeature.UseTypeSubsumptionCache, languageVersion100 - + LanguageFeature.AllowObjectExpressionWithoutOverrides, languageVersion100 LanguageFeature.DontWarnOnUppercaseIdentifiersInBindingPatterns, languageVersion100 LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, languageVersion100 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 30256560262..bfa44185a1c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -74,6 +74,7 @@ let main _ = let ``IWSAM test files`` compilation = compilation |> setupCompilation false + |> withLangVersionPreview |> compileAndRun |> shouldSucceed @@ -1399,6 +1400,7 @@ let inline length2 (x: ^a when ^a: (member Length: int with public get)) = x.Len let inline length3 (x: ^a when ^a: (member Length: int with public set)) = x.set_Length(1) let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() """ + |> withLangVersionPreview |> withRealInternalSignature realsig |> typecheck |> shouldFail diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl index b5e699f5f64..0aa857e7a0e 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl @@ -9,4 +9,5 @@ latestmajor 6.0 7.0 8.0 -9.0 (Default) \ No newline at end of file +9.0 +10.0 (Default) \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier01.fs deleted file mode 100644 index 1a425cc70ac..00000000000 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier01.fs +++ /dev/null @@ -1,14 +0,0 @@ -// Regression test for DevDiv:305886 -// [QueryExpressions] Identifiers for range variables in for-join queries cannot be uppercase! -// We expect a simple warning. -//Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name\.$ - -module M -// Warning -let _ = - query { - for UpperCase in [1..10] do - join b in [1..2] on (UpperCase = b) - select b -} - diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier02.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier02.fs deleted file mode 100644 index b7bcb21fffb..00000000000 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier02.fs +++ /dev/null @@ -1,13 +0,0 @@ -// Regression test for DevDiv:305886 -// [QueryExpressions] Identifiers for range variables in for-join queries cannot be uppercase! -// We expect a simple warning. -//Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name\.$ - -module M -// Warning -let _ = - query { - for UpperCase in [1..10] do - groupBy UpperCase into g - select g.Key -} diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier03.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier03.fs deleted file mode 100644 index 0df77bb848e..00000000000 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/W_UppercaseIdentifier03.fs +++ /dev/null @@ -1,14 +0,0 @@ -// Regression test for DevDiv:305886 -// [QueryExpressions] Identifiers for range variables in for-join queries cannot be uppercase! -// We expect a simple warning. -//Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name\.$ - -module M -// Warning -let _ = - query { - for UpperCase in [1..10] do - groupJoin UpperCase2 in [|1..2|] on (UpperCase = UpperCase2) into g - for k in g do - select (k + 1) -} diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/env.lst b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/env.lst index 58c79d96417..68e5ecedbfb 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/env.lst +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/env.lst @@ -42,9 +42,6 @@ NoMT SOURCE=E_Sequential01.fs SCFLAGS="--test:ErrorRanges" # NoMT SOURCE=JoinsWithInterveningExpressions01.fs # JoinsWithInterveningExpressions01.fs -NoMT SOURCE=W_UppercaseIdentifier01.fs SCFLAGS="-a --test:ErrorRanges" # W_UppercaseIdentifier01.fs -NoMT SOURCE=W_UppercaseIdentifier02.fs SCFLAGS="-a --test:ErrorRanges" # W_UppercaseIdentifier02.fs -NoMT SOURCE=W_UppercaseIdentifier03.fs SCFLAGS="-a --test:ErrorRanges" # W_UppercaseIdentifier03.fs NoMT SOURCE=UppercaseIdentifier04.fs SCFLAGS="-a --warnaserror" # UppercaseIdentifier04.fs NoMT SOURCE=E_Zip01.fs SCFLAGS="--test:ErrorRanges" # E_Zip01.fs \ No newline at end of file From 24197e2e74dbdded5f294800f3f2f73ce2207697 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 27 Jun 2025 13:17:28 +0200 Subject: [PATCH 08/10] constructor attribute syntax --- .../Regressions/ReflectedDefinitionConstructor02.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Regressions/ReflectedDefinitionConstructor02.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Regressions/ReflectedDefinitionConstructor02.fs index d45a79cb8f2..03aa1302dd5 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Regressions/ReflectedDefinitionConstructor02.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Regressions/ReflectedDefinitionConstructor02.fs @@ -5,7 +5,7 @@ open Microsoft.FSharp.Quotations open Microsoft.FSharp.Quotations.Patterns -type Foo[]() = +type Foo []() = let x = 2 member this.Test y = x + y From a9496b79218ccad2ecead5b4ac493f9d8fea5850 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 27 Jun 2025 13:23:50 +0200 Subject: [PATCH 09/10] nowarn - #load no longer imports nowarns --- .../LegacyLanguageService/Tests.LanguageService.Script.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index cef4a0e71aa..44a8e8b93e1 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -518,8 +518,7 @@ type UsingMSBuild() as this = let script1 = OpenFile(project,"Script1.fsx") MoveCursorToEndOfMarker(script1,"let y = f") TakeCoffeeBreak(this.VS) - AssertNoErrorsOrWarnings(project) - // AssertExactlyOneErrorSeenContaining(project, "This construct is deprecated. x") // This is expected for langVersion >= 10.0 + AssertExactlyOneErrorSeenContaining(project, "This construct is deprecated. x") // This is expected for langVersion >= 10.0 /// FEATURE: #r in .fsx to a .dll name works. [] From acf72cd57c13f4b86cf7a2b373cdafdeb028e3ee Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 1 Jul 2025 10:33:46 +0000 Subject: [PATCH 10/10] fantomas --- src/Compiler/Facilities/LanguageFeatures.fs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index d31ff31a5fe..daabcd21d1b 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -224,7 +224,6 @@ type LanguageVersion(versionText) = LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, languageVersion90 LanguageFeature.EmptyBodiedComputationExpressions, languageVersion90 - // F# 10.0 LanguageFeature.EnforceAttributeTargets, languageVersion100 LanguageFeature.UseTypeSubsumptionCache, languageVersion100