diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 246ec741d6..a69b9dae12 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,24 @@ 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 + LanguageFeature.UseTypeSubsumptionCache, 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 + LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, previewVersion // Stopped printing arguments to indexed properties ] static let defaultLanguageVersion = LanguageVersion("default") @@ -260,6 +265,8 @@ type LanguageVersion(versionText) = | "8" -> languageVersion80 | "9.0" | "9" -> languageVersion90 + | "10.0" + | "10" -> languageVersion100 | _ -> 0m let specified = getVersionFromString versionText diff --git a/start-vs-FsharpSln.cmd b/start-vs-FsharpSln.cmd new file mode 100644 index 0000000000..8dc2074cd4 --- /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 dfbb6d3a73..4eeccde460 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) @@ -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 592b3ac09e..6ea2a0ca15 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/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs index a2ee105f91..70d72f9485 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 44ee388af9..6bb4761f7b 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 1f4462fa6d..2fa6373a92 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 4d0843014e..508314ee94 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 8ba293dce2..3c41d7d653 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/BasicGrammarElements/UseBindings/UseBangBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs index 37c1447e89..77ac4e5706 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 = @@ -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/Conformance/Expressions/BindingExpressions/BindingExpressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs index f3f3d9d9d3..017e5b8a61 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/Expressions/ComputationExpressions/ComputationExpressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ComputationExpressions/ComputationExpressions.fs index 2738c70113..8e34072696 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 45e97d5748..7838300082 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/LexicalFiltering/HighPrecedenceApplication/HighPrecedenceApplication.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/HighPrecedenceApplication/HighPrecedenceApplication.fs index 4ec5b1b53d..f1d46256a5 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/Simple/Simple.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple/Simple.fs index 8b556d25cf..12a14060c2 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 88e98b1454..6aec715af3 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Union/Union.fs @@ -218,24 +218,23 @@ 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 = 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 be7d0bf7ee..69c14a8d41 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,15 +34,16 @@ module AnonRecd = let c = {|a=1 |} let d = {| a=1; b=2; c=3 |} """ + |> withLangVersion90 |> 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.") ] [] - let ``Preview : Anonymous Record with unit of measures`` () = + let ``Anonymous Record with unit of measures`` () = FSharp """ namespace FSharpTest @@ -55,12 +56,11 @@ module AnonRecd = let c = {|a=1 |} let d = {| a=1; b=2; c=3 |} """ - |> withLangVersionPreview |> compile |> shouldSucceed [] - let ``Anonymous Record with typeof`` () = + let ``Anonymous Record with typeof -v9`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -69,15 +69,16 @@ module AnonRecd = let c = {| a=typeof|} let d = {| a=typeof |} """ + |> withLangVersion90 |> 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.") ] [] - let ``Preview: Anonymous Record with typeof`` () = + let ``Anonymous Record with typeof`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -86,12 +87,11 @@ module AnonRecd = let c = {| a=typeof|} let d = {| a=typeof |} """ - |> withLangVersionPreview |> compile |> shouldSucceed [] - let ``Anonymous Record with typedefof`` () = + let ``Anonymous Record with typedefof -v9`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -100,15 +100,16 @@ module AnonRecd = let c = {| a=typedefof<_ option>|} let d = {| a=typedefof<_ option> |} """ + |> withLangVersion90 |> 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.") ] [] - let ``Preview: Anonymous Record with typedefof`` () = + let ``Anonymous Record with typedefof`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -117,12 +118,11 @@ module AnonRecd = let c = {| a=typedefof<_ option>|} let d = {| a=typedefof<_ option> |} """ - |> withLangVersionPreview |> compile |> shouldSucceed [] - let ``Anonymous Record with nameof`` () = + let ``Anonymous Record with nameof -v9`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -131,15 +131,16 @@ module AnonRecd = let c<'T> = {| a=nameof<'T>|} let d<'T> = {| a=nameof<'T> |} """ + |> withLangVersion90 |> 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.") ] [] - let ``Preview: Anonymous Record with nameof`` () = + let ``Anonymous Record with nameof`` () = FSharp """ namespace FSharpTest module AnonRecd = @@ -148,7 +149,6 @@ module AnonRecd = let c<'T> = {| a=nameof<'T>|} let d<'T> = {| a=nameof<'T> |} """ - |> withLangVersionPreview |> compile |> shouldSucceed @@ -509,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 @@ -528,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 @@ -547,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 @@ -562,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 @@ -577,7 +574,6 @@ let nested = let nested2 : {| A: {| B: Expr |}; C: Expr |} = {| A = {| B = <@ 42 @>|}; C = <@@ true @@>|} """ - |> withLangVersionPreview |> compile |> shouldSucceed @@ -605,11 +601,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 +628,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,11 +650,11 @@ 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.") ] [] - 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 @@ -672,8 +668,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 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 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 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/Conformance/Types/UnionTypes/UnionStructTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs index 0ec6dc9963..18637179b2 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 8dc1184ea3..ba40e16515 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 2f03e5de0e..436072744e 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/ActivePatternArgCountMismatchTest.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ActivePatternArgCountMismatchTest.fs index 09de043f4f..60e1a5e98b 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 81ce04fc05..e876eef090 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/ErrorMessages/TypeMismatchTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs index 53cb33b5b7..d645f4d5a9 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs @@ -360,13 +360,13 @@ let foo items = [] let main args = - foo ({1..10} |> Seq.pairwise) + foo (seq {1..10} |> Seq.pairwise) 0 """ |> asExe |> 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") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/ByrefTests.fs b/tests/FSharp.Compiler.ComponentTests/Interop/ByrefTests.fs index e5a278a4a8..487b7f6ee1 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 8ae8d85db6..382d3395ab 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 da918ffc00..b9dc7b2b76 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.") ] [] @@ -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/Nullness/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs index bb67476cb9..d969afc538 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 8490b41a75..b454f29160 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 @@ -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.") ] [] @@ -685,7 +685,7 @@ let f1() = yield (1 : int) } """ - |> withLangVersionPreview + |> withLangVersion10 |> asExe |> ignoreWarnings |> compileAndRun @@ -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.") ] [] @@ -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 fdca603578..4e71a676ef 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 f6b31e62d2..d025052b6f 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.Compiler.Service.Tests/WarnScopeTests.fs b/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs index 6348fa560f..b55cca7fab 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 diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index e3c9269a5b..d3ee539486 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 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 b5e699f5f6..0aa857e7a0 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 1a425cc70a..0000000000 --- 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 b7bcb21fff..0000000000 --- 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 0df77bb848..0000000000 --- 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 58c79d9641..68e5ecedbf 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 diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Regressions/ReflectedDefinitionConstructor02.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Regressions/ReflectedDefinitionConstructor02.fs index d45a79cb8f..03aa1302dd 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 diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index cef4a0e71a..44a8e8b93e 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. []