From 374b6fafe28e2c6844ec97842908e78826a9993e Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 14 Aug 2023 11:51:05 +0200 Subject: [PATCH 01/18] F#8 --- src/Compiler/Facilities/LanguageFeatures.fs | 56 ++++++++-------- .../CompilerOptions/fsc/warn/warn.fs | 2 +- .../StaticLet/StaticLetInUnionsAndRecords.fs | 15 +++-- .../WarnForAutoOpenAttributeAlias.fs | 2 +- .../Conformance/Constraints/Unmanaged.fs | 14 ++-- .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 2 +- .../ConstraintSolver/ObjInference.fs | 14 ++-- .../Diagnostics/Records.fs | 6 +- .../EmittedIL/ArgumentNames.fs | 10 +-- .../EmittedIL/Enums.fs | 4 +- .../EmittedIL/Literals.fs | 16 ++--- .../MethodImplAttribute.fs | 2 +- .../ErrorMessages/ClassesTests.fs | 22 +++---- .../ErrorMessages/NameResolutionTests.fs | 10 +-- .../ErrorMessages/TailCallAttribute.fs | 64 +++++++++---------- .../UnionCasePatternMatchingErrors.fs | 16 ++--- .../Language/ConstraintIntersectionTests.fs | 6 +- .../Language/CopyAndUpdateTests.fs | 26 ++++---- .../Language/DotLambdaTests.fs | 26 ++++---- .../Language/ExtensionMethodTests.fs | 32 +++++----- .../Language/InterfaceTests.fs | 8 +-- .../Language/InterpolatedStringsTests.fs | 14 ++-- .../Language/NameofTests.fs | 3 +- .../Language/PrintfFormatTests.fs | 6 +- .../Language/SequenceExpressionTests.fs | 12 ++-- .../Language/StaticClassTests.fs | 53 +++++++-------- .../Language/WhileBangTests.fs | 8 +-- .../Signatures/SigGenerationRoundTripTests.fs | 4 +- .../NullableOptionalRegressionTests.fs | 6 +- 29 files changed, 234 insertions(+), 225 deletions(-) diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 342c4f55a39..73127fe1957 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -87,10 +87,11 @@ type LanguageVersion(versionText) = static let languageVersion50 = 5.0m static let languageVersion60 = 6.0m static let languageVersion70 = 7.0m + static let languageVersion80 = 8.0m static let previewVersion = 9999m // Language version when preview specified - static let defaultVersion = languageVersion70 // Language version when default specified + static let defaultVersion = languageVersion80 // Language version when default specified static let latestVersion = defaultVersion // Language version when latest specified - static let latestMajorVersion = languageVersion70 // Language version when latestmajor specified + static let latestMajorVersion = languageVersion80 // Language version when latestmajor specified static let validOptions = [| "preview"; "default"; "latest"; "latestmajor" |] @@ -102,6 +103,7 @@ type LanguageVersion(versionText) = languageVersion50 languageVersion60 languageVersion70 + languageVersion80 |] static let features = @@ -152,31 +154,33 @@ type LanguageVersion(versionText) = LanguageFeature.InterfacesWithAbstractStaticMembers, languageVersion70 LanguageFeature.SelfTypeConstraints, languageVersion70 + // F# 8.0 + LanguageFeature.AccessorFunctionShorthand, languageVersion80 + LanguageFeature.MatchNotAllowedForUnionCaseWithNoData, languageVersion80 + LanguageFeature.CSharpExtensionAttributeNotRequired, languageVersion80 + LanguageFeature.ErrorForNonVirtualMembersOverrides, languageVersion80 + LanguageFeature.WarningWhenInliningMethodImplNoInlineMarkedFunction, languageVersion80 + LanguageFeature.EscapeDotnetFormattableStrings, languageVersion80 + LanguageFeature.ArithmeticInLiterals, languageVersion80 + LanguageFeature.ErrorReportingOnStaticClasses, languageVersion80 + LanguageFeature.TryWithInSeqExpression, languageVersion80 + LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields, languageVersion80 + LanguageFeature.StaticMembersInInterfaces, languageVersion80 + LanguageFeature.NonInlineLiteralsAsPrintfFormat, languageVersion80 + LanguageFeature.NestedCopyAndUpdate, languageVersion80 + LanguageFeature.ExtendedStringInterpolation, languageVersion80 + LanguageFeature.WarningWhenMultipleRecdTypeChoice, languageVersion80 + LanguageFeature.ImprovedImpliedArgumentNames, languageVersion80 + LanguageFeature.DiagnosticForObjInference, languageVersion80 + LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, languageVersion80 + LanguageFeature.StaticLetInRecordsDusEmptyTypes, languageVersion80 + LanguageFeature.StrictIndentation, languageVersion80 + LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80 + LanguageFeature.UnmanagedConstraintCsharpInterop, languageVersion80 + LanguageFeature.WhileBang, languageVersion80 + // F# preview LanguageFeature.FromEndSlicing, previewVersion - LanguageFeature.AccessorFunctionShorthand, previewVersion - LanguageFeature.MatchNotAllowedForUnionCaseWithNoData, previewVersion - LanguageFeature.CSharpExtensionAttributeNotRequired, previewVersion - LanguageFeature.ErrorForNonVirtualMembersOverrides, previewVersion - LanguageFeature.WarningWhenInliningMethodImplNoInlineMarkedFunction, previewVersion - LanguageFeature.EscapeDotnetFormattableStrings, previewVersion - LanguageFeature.ArithmeticInLiterals, previewVersion - LanguageFeature.ErrorReportingOnStaticClasses, previewVersion - LanguageFeature.TryWithInSeqExpression, previewVersion - LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields, previewVersion - LanguageFeature.StaticMembersInInterfaces, previewVersion - LanguageFeature.NonInlineLiteralsAsPrintfFormat, previewVersion - LanguageFeature.NestedCopyAndUpdate, previewVersion - LanguageFeature.ExtendedStringInterpolation, previewVersion - LanguageFeature.WarningWhenMultipleRecdTypeChoice, previewVersion - LanguageFeature.ImprovedImpliedArgumentNames, previewVersion - LanguageFeature.DiagnosticForObjInference, previewVersion - LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, previewVersion - LanguageFeature.StaticLetInRecordsDusEmptyTypes, previewVersion - LanguageFeature.StrictIndentation, previewVersion - LanguageFeature.ConstraintIntersectionOnFlexibleTypes, previewVersion - LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion - LanguageFeature.WhileBang, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -196,6 +200,8 @@ type LanguageVersion(versionText) = | "6" -> languageVersion60 | "7.0" | "7" -> languageVersion70 + | "8.0" + | "8" -> languageVersion80 | _ -> 0m let specified = getVersionFromString versionText diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/warn/warn.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/warn/warn.fs index 42ba827de61..9dd6dea0e91 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/warn/warn.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/warn/warn.fs @@ -11,7 +11,7 @@ module TestCompilerWarningLevel = [] let ``warn_level0_fs --warn:0`` compilation = compilation - |> withLangVersionPreview + |> withLangVersion80 |> asExe |> withOptions ["--warn:0"] |> compileAndRun diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs index 1a40189bb9e..7cb59b37d3f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs @@ -27,6 +27,7 @@ let ``Should fail in F# 7 and lower`` (implFileName:string) = [] [] +[] [] let ``Regression in Member val - not allowed without primary constructor`` (langVersion:string) = Fs """module Test @@ -40,6 +41,7 @@ type Bad3 = [] [] +[] [] let ``Regression - Type augmentation with abstract slot not allowed`` (langVersion:string) = Fs """module Test @@ -53,6 +55,7 @@ type System.Random with [] [] +[] [] let ``Regression - record with abstract slot not allowed`` (langVersion:string) = Fs """module Test @@ -65,7 +68,7 @@ type myRecord2 = { field1: int; field2: string } let verifyCompileAndRun compilation = compilation - |> withLangVersionPreview + |> withLangVersion80 |> asExe |> compileAndRun @@ -95,7 +98,7 @@ init R 2 [] let ``Static let - lowercase DU`` compilation = compilation - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -127,7 +130,7 @@ let ``Static let in simple union`` compilation = [] let ``Support in plain enums - typecheck should fail`` compilation = compilation - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnosticMessage "Enumerations cannot have members" @@ -274,7 +277,7 @@ Creating cached val for Uri [] let ``Static let record - generics - IL test`` compilation = compilation - |> withLangVersionPreview + |> withLangVersion80 |> compile |> verifyIL [""" .method private specialname rtspecialname static void .cctor() cil managed @@ -389,7 +392,7 @@ type X = static do Console.WriteLine("from type") do Console.WriteLine("module after type") """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -464,7 +467,7 @@ Console.Write(MyTypes.X.GetX) FSharp types |> withAdditionalSourceFiles [SourceCodeFileKind.Create("program.fs", program)] - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs index f15f6199d3c..b1d60d36842 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs @@ -15,7 +15,7 @@ type ByItsOwnNatureUnBottledAttribute = Microsoft.FSharp.Core.AutoOpenAttribute module Foo = let bar = 0 """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs index af067fda340..514e2023f2e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs @@ -361,7 +361,7 @@ let _ = Test>>() [] let ``Multi constraint IL test together with struct and interface constraints`` () = Fsx "[] type Test<'T when 'T: unmanaged and 'T: struct and 'T:>System.IComparable> = struct end" - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -387,7 +387,7 @@ let _ = Test>>() [] let ``IsUnmanagedAttribute Attribute is emitted for function with unmanaged constraint`` () = Fsx "let testMyFunction (x: 'TUnmanaged when 'TUnmanaged : unmanaged) = struct(x,1)" - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -418,7 +418,7 @@ let _ = Test>>() open CsLib let y = new CsharpStruct(struct(1,"this is string")) """ |> withReferences [csLib] - |> withLangVersionPreview + |> withLangVersion80 app |> compile @@ -449,7 +449,7 @@ printf "%s" (CsharpStruct.Hi()) """ |> withReferences [csLib] app - |> withLangVersionPreview + |> withLangVersion80 |> asExe |> compile |> run @@ -458,7 +458,7 @@ printf "%s" (CsharpStruct.Hi()) [] let ``FSharp generates modreq for CSharp to consume in preview`` () = Fsx "let testMyFunction (x: 'TUnmanaged when 'TUnmanaged : unmanaged) = ()" - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -495,7 +495,7 @@ type FsharpStructWrapper<'TInner when 'TInner: unmanaged> = val Item : 'TInner with static member Hi() = typeof<'TInner>.Name""" |> asLibrary - |> withLangVersionPreview + |> withLangVersion80 |> withName "fsLib" let app = @@ -541,7 +541,7 @@ module FsharpPreparedData = let structDuExample2 = B "42" """ |> asLibrary - |> withLangVersionPreview + |> withLangVersion80 |> withName "fsLib" let app = 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 63c78877f81..f82da4d8d80 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -60,7 +60,7 @@ let main _ = let ``IWSAM test files`` compilation = compilation |> setupCompilation - |> withLangVersionPreview + |> withLangVersion80 |> compileAndRun |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/ObjInference.fs b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/ObjInference.fs index 358e10a2fa4..32950d8ba4c 100644 --- a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/ObjInference.fs +++ b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/ObjInference.fs @@ -37,7 +37,7 @@ let x = deserialize "" |> f""", 3, 9, 3, 28 FSharp code |> withErrorRanges |> withWarnOn 3559 - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Information 3559, Line line1, Col col1, Line line2, Col col2, message) @@ -76,7 +76,7 @@ let f () = x = x |> ignore""" // measure is inferred as 1, but that's not covere let ``Warning does not fire unless required``(code: string) = FSharp code |> withWarnOn 3559 - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -93,7 +93,7 @@ let f () = x = x |> ignore""" // measure is inferred as 1, but that's not covere sprintf "%s |> ignore" expr |> FSharp |> withWarnOn 3559 - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -103,7 +103,7 @@ let f () = x = x |> ignore""" // measure is inferred as 1, but that's not covere sprintf "<@ %s @> |> ignore" expr |> FSharp |> withWarnOn 3559 - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -113,7 +113,7 @@ let f () = x = x |> ignore""" // measure is inferred as 1, but that's not covere sprintf "<@ %s @> |> ignore" expr |> FSharp |> withWarnOn 3559 - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Information 3559, Line line1, Col (col1 + 3), Line line2, Col (col2 + 3), message) @@ -124,7 +124,7 @@ let f () = x = x |> ignore""" // measure is inferred as 1, but that's not covere sprintf "<@ %s @> |> ignore" expr |> FSharp |> withWarnOn 3559 - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -133,7 +133,7 @@ let f () = x = x |> ignore""" // measure is inferred as 1, but that's not covere let ``Warning is off by default``(expr: string, _: int, _: int, _: int, _: int) = expr |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> withOptions ["--warnaserror"] |> typecheck |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Diagnostics/Records.fs b/tests/FSharp.Compiler.ComponentTests/Diagnostics/Records.fs index 298b220c714..70dcd710e34 100644 --- a/tests/FSharp.Compiler.ComponentTests/Diagnostics/Records.fs +++ b/tests/FSharp.Compiler.ComponentTests/Diagnostics/Records.fs @@ -16,7 +16,7 @@ type R = { F1: int; F2: string } let updateOk r = { r with F1 = 1 } let updateWarn r = { r with F1 = 1; F2 = "" } """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -45,7 +45,7 @@ type R = { F1: int; F2: string } let updateWarn r = { r with F1 = 1; F2 = "" } """ - |> withLangVersionPreview + |> withLangVersion80 |> withOptions ["--nowarn:3560"] |> typecheck |> shouldSucceed @@ -85,7 +85,7 @@ let t2 (x: RecTy) (a: AnotherNestedRecTy) = { x with D.C.c = { a with A = 3 } } // vvvvvvvvvvvvvvvvvvvvvvv let t3 (x: RecTy) (a: AnotherNestedRecTy) = { x with D.C.c = { a with A = 3; B = 4 } } """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ArgumentNames.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ArgumentNames.fs index 5387e979ea4..8b0aa7efb2c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ArgumentNames.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ArgumentNames.fs @@ -19,7 +19,7 @@ type M (name: string, count: int) = let test1 = M let test2 = M.Open """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -56,7 +56,7 @@ type M = let test1 = M.Write """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -91,7 +91,7 @@ type Ext = let test1 = (3).Print """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -120,7 +120,7 @@ type DU = let test1 = X let test2 = Case1 """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" @@ -160,7 +160,7 @@ let add num1 num2 = printfn "%d" (num1 + num2) let test1 = System.Action<_, _>(add) """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [""" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs index ae42c56fb21..c3122581db0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs @@ -20,7 +20,7 @@ type Flags = | B = (one <<< 1) | C = (one <<< (one * 2)) """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [ @@ -38,7 +38,7 @@ type E = | A = (1L <<< 0) | B = (1 <<< 1) """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResult { diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs index 77a3e8786f9..59a82186fc1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs @@ -44,7 +44,7 @@ let [] bitwise = 1us &&& (3us ||| 4us) let [] bitwise2 = 1y ^^^ (3y + ~~~4y) """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [ @@ -73,7 +73,7 @@ let [] secondsInDayPlusThree = 3.1f + (60f * 60f * 24f) let [] chars = 'a' + 'b' - 'a' """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [ @@ -106,7 +106,7 @@ let [] complex2 = false || (flag && flippedFlag) let [] complex3 = true || (flag && not flippedFlag) """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [ @@ -130,7 +130,7 @@ type E = let [] x = enum (1 + 1) """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [ @@ -149,7 +149,7 @@ open System.Runtime.CompilerServices let x () = 3 """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed |> verifyIL [ @@ -163,7 +163,7 @@ module LiteralArithmetic let [] x = System.Int32.MaxValue + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResult { @@ -182,7 +182,7 @@ module LiteralArithmetic let [] x = 1m + 1m """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -213,7 +213,7 @@ module LiteralArithmetic let [] x = 1 + System.DateTime.Now.Hour """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs index 7acefc4ba54..a13fee6baaf 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs @@ -37,7 +37,7 @@ module MethodImplAttribute = [] let ``NoInlining_fs with inline keyword => should warn in preview version`` compilation = compilation - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> withSingleDiagnostic (Warning 3151, Line 2, Col 1, Line 3, Col 38, "This member, function or value declaration may not be declared 'inline'") diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs index a1dbbe9f135..a43e7eb2491 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs @@ -147,7 +147,7 @@ type C() = override this.M4() = () member this.M5() = () """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -245,7 +245,7 @@ type B() = member this.M5() = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -274,7 +274,7 @@ type B() = member this.M4() = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -346,7 +346,7 @@ type C() = member this.M5() = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -424,7 +424,7 @@ type C() = member this.M5() = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -498,7 +498,7 @@ type C() = member this.M5() = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -568,7 +568,7 @@ type C() = override _.M1 (i: int) = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -595,7 +595,7 @@ type C() = override _.M1 (i: string) = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -623,7 +623,7 @@ type Over () = app |> withReferences [CSLib] - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -651,7 +651,7 @@ type PD() = override this.M(x: int) = () """ app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withSingleDiagnostic (Error 361, Line 19, Col 19, Line 19, Col 20, "The override 'M: int -> unit' implements more than one abstract slot, e.g. 'abstract PB.M: 'a -> unit' and 'abstract PA.M: int -> unit'") @@ -684,6 +684,6 @@ type X = override this.M(a, b, c, d) = () """ |> withReferences [CSLib] app - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/NameResolutionTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/NameResolutionTests.fs index 3b41ae6b6eb..d40e5e8d43c 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/NameResolutionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/NameResolutionTests.fs @@ -72,7 +72,7 @@ module Lib = [] let MultipleRecdTypeChoiceWarningWith1AlternativeLangPreview () = FSharp multipleRecdTypeChoiceWarningWith1AlternativeSource - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -129,7 +129,7 @@ module Lib = [] let MultipleRecdTypeChoiceWarningWith2AlternativeLangPreview () = FSharp multipleRecdTypeChoiceWarningWith2AlternativeSource - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -186,7 +186,7 @@ module Lib = [] let MultipleRecdTypeChoiceWarningNotRaisedWithCorrectOpenStmtsOrderingLangPreview () = FSharp multipleRecdTypeChoiceWarningNotRaisedWithCorrectOpenStmtsOrderingSource - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -235,7 +235,7 @@ module Lib = [] let MultipleRecdTypeChoiceWarningNotRaisedWithoutOverlapsLangPreview () = FSharp multipleRecdTypeChoiceWarningNotRaisedWithoutOverlapsSource - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -284,7 +284,7 @@ module Lib = [] let MultipleRecdTypeChoiceWarningNotRaisedWithTypeAnnotationsLangPreview () = FSharp multipleRecdTypeChoiceWarningNotRaisedWithTypeAnnotationsSource - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs index a1e32599137..3365b3e1265 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs @@ -21,7 +21,7 @@ namespace N else (fact (n - 1) (mul n acc)) + 23 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -50,7 +50,7 @@ namespace N | _ -> (fact (n - 1) (mul n acc)) + 23 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -81,7 +81,7 @@ namespace N r + 23 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -115,7 +115,7 @@ namespace N r |> ignore """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -150,7 +150,7 @@ namespace N bar (x - 1) // OK: tail-recursive call. """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -179,7 +179,7 @@ namespace N member this.InnerCMeth x = this.InnerCMeth x + 23 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -216,7 +216,7 @@ namespace N c.M1() """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -239,7 +239,7 @@ namespace N this.M1() // ok """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -262,7 +262,7 @@ namespace N this.M1() + 2 // should warn """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -310,7 +310,7 @@ namespace N fact 100000 1 |> ignore """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -330,7 +330,7 @@ namespace N } """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -357,7 +357,7 @@ namespace N } """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -387,7 +387,7 @@ namespace N let a: seq = f 10 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -408,7 +408,7 @@ namespace N let a: Async = f 10 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -426,7 +426,7 @@ namespace N } """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -463,7 +463,7 @@ namespace N M.M2.m2func() """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -483,7 +483,7 @@ namespace N let m2func() = 2 + M1.m1func() """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -515,7 +515,7 @@ namespace N let run() = let mutable x = 0 in foo(&x) """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -567,7 +567,7 @@ namespace N } """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -626,7 +626,7 @@ namespace N CheckDefnInModule cenv env mspec """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -680,7 +680,7 @@ namespace N else 28 """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -720,7 +720,7 @@ namespace N foldBackOpt f m a """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -754,7 +754,7 @@ namespace N loop xs """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -775,7 +775,7 @@ namespace N head :: tail """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -802,7 +802,7 @@ namespace N | x :: xs -> (x + 1) :: addOne xs """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -829,7 +829,7 @@ namespace N | x :: xs -> addOne xs ((x + 1) :: acc) """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -851,7 +851,7 @@ namespace N | Node (l, r) -> System.Math.Max(findMax l, findMax r) """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withResults [ @@ -908,7 +908,7 @@ namespace N ) """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -935,7 +935,7 @@ namespace N |> finalContinuation) """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -967,7 +967,7 @@ namespace N | _ -> failwith "Nodes with lists longer than 2 are not supported" """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -1004,7 +1004,7 @@ namespace N Continuation.sequence continuations finalContinuation """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -1042,6 +1042,6 @@ module M = } """ |> FSharp - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnionCasePatternMatchingErrors.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnionCasePatternMatchingErrors.fs index c6671c81893..fcad42227fb 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnionCasePatternMatchingErrors.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnionCasePatternMatchingErrors.fs @@ -82,7 +82,7 @@ let x: X = X let myVal = match x with | X _ -> ()""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Warning 3548, Line 9, Col 7, Line 9, Col 10, "Pattern discard is not allowed for union case that takes no data.") @@ -129,7 +129,7 @@ let x: X = X let myVal = function | X _ -> ()""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Warning 3548, Line 9, Col 7, Line 9, Col 10, "Pattern discard is not allowed for union case that takes no data.") @@ -150,7 +150,7 @@ let myVal = | A _ -> 15 | B (x, _, _) -> 16 | C _ -> 17""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Warning 3548, Line 12, Col 7, Line 12, Col 10, "Pattern discard is not allowed for union case that takes no data.") @@ -171,7 +171,7 @@ let myVal = | A _ -> 15 | B (x, _, _) -> 16 | C _ -> 17""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Warning 3548, Line 12, Col 7, Line 12, Col 10, "Pattern discard is not allowed for union case that takes no data.") @@ -212,7 +212,7 @@ let myVal = | A _ | B _ | C _ -> 17""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Warning 3548, Line 12, Col 7, Line 12, Col 10, "Pattern discard is not allowed for union case that takes no data.") @@ -237,7 +237,7 @@ let myVal = | A _, D -> 15 | B (x, _, _), D _ -> 16 | C _, _ -> 17""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -265,7 +265,7 @@ let myVal = | A _, D -> 15 | B (x, _, _), D _ -> 16 | C _, _ -> 17""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -306,7 +306,7 @@ type MyWrapper = A let myFunc(A a) = 5+5 let myDiscardedArgFunc(A _) = 5+5""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ConstraintIntersectionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ConstraintIntersectionTests.fs index 0e0fee22505..63cc6e18dfa 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ConstraintIntersectionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ConstraintIntersectionTests.fs @@ -47,7 +47,7 @@ let z (f: #I & #IDisposable & #Task & #seq, name: string) = f.Result |> ignore f.Dispose () """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -67,7 +67,7 @@ type C<'t & #seq & #IDisposable, 'y & #seq<'t>> = for x in xs do printfn "%d" x """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -78,7 +78,7 @@ type C<'t & #seq & System.IDisposable, 'y & #seq<'t>> = class end let y (f: #seq & System.IDisposable) = () """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs index 39e35ccc9b3..d02ec75cd9d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs @@ -13,7 +13,7 @@ type RecTy = { D: NestdRecTy; E: string option } let t2 x = { x with D.B = "a"; D.B = "b" } """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -49,7 +49,7 @@ type RecTy = { D: NestdRecTy; E: string option } let t2 x = { x with D.B.A = 1; D.C = "ads" } """ - |> withLangVersionPreview + |> withLangVersion80 |> withNoDebug |> withOptimize |> compile @@ -106,7 +106,7 @@ if actual1 <> expected1 then if actual2 <> expected2 then failwith "actual2 does not equal expected2" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed @@ -127,7 +127,7 @@ let expected = { ``A.B`` = "barAB"; A = { B = "barB" }; C = 42 } if actual <> expected then failwith "actual does not equal expected" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed @@ -156,7 +156,7 @@ if actual1 <> expected1 then if actual2 <> expected2 then failwith "actual2 does not equal expected2" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed @@ -187,7 +187,7 @@ if actual1 <> expected1 then if actual2 <> expected2 then failwith "actual2 does not equal expected2" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed @@ -210,7 +210,7 @@ if actual1 <> expected1 then if actual2 <> expected2 then failwith "actual2 does not equal expected2" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed @@ -247,7 +247,7 @@ let c3 = { U.G.U = Unchecked.defaultof<_>; I = 3 } let c4 = { U.U = Unchecked.defaultof<_>; I = 3 } """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -268,7 +268,7 @@ let expected = { T = "a"; I = -1; U = {| a = { T = "a"; I = 2; U = {| a = { T = if actual <> expected then failwith "actual does not equal expected" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed @@ -289,7 +289,7 @@ let actual1 = { t1 with D.B = 1 } let actual2 = { t1 with D.C.A = 3; E = Some 1.0 } """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withResults [ @@ -333,7 +333,7 @@ let expected = {| R = { D = 2; E = None }; S = "May I be a string now?"; T = 4 | if actual <> expected then failwith "actual does not equal expected" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed @@ -346,7 +346,7 @@ type RecTy = { D: int; E: {| A: int |} } let f x = { x with E.A = "May I be a string now?" } """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withResult { @@ -378,7 +378,7 @@ let t5 (x: {| a: int; b: NestdRecTy |}) = {| x with b.C = "a" |} let t6 (x: {| a: int; b: NestdRecTy |}) = {| x with b.G.b = "a" |} let t7 (x: {| a: int; b: NestdRecTy |}) = {| x with c.D = "a" |} """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs index f038fc67f10..fe0b2cad30b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs @@ -14,7 +14,7 @@ let ``Underscore Dot ToString`` () = Fsx """ let x = "a" |> _.ToString() printfn "%s" x""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -22,7 +22,7 @@ printfn "%s" x""" let ``Underscore Dot ToString With Space Before Paranthesis - NonAtomic`` () = Fsx """ let x = "a" |> _.ToString () """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -36,7 +36,7 @@ let ``Underscore Dot Curried Function With Arguments - NonAtomic`` () = type MyRecord = {MyRecordField:string} with member x.DoStuff a b c = $"%s{x.MyRecordField} %i{a} %i{b} %i{c}" let myFunction (x:MyRecord) = x |> _.DoStuff 1 2 3""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -49,7 +49,7 @@ let ``Underscore Dot Length on string`` () = let x = "a" |> _.Length printfn "%i" x """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -60,7 +60,7 @@ let a : (string array -> _) = _.Length let b = _.ToString() let c = _.ToString().Length //let c = _.ToString()[0] """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -72,14 +72,14 @@ let getnumberOutOfDU x = match x with | A -> 42 | _ -> 43""" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed [] let ``DotLambda does NOT generalize automatically to a member based SRTP`` () = Fsx "let inline myFunc x = x |> _.WhatANiceProperty" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [(Error 72, Line 1, Col 28, Line 1, Col 47, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.")] @@ -87,14 +87,14 @@ let ``DotLambda does NOT generalize automatically to a member based SRTP`` () = [] let ``DotLambda does allow member based SRTP if labelled explicitely`` () = Fsx "let inline myFunc<'a when 'a:(member WhatANiceProperty: int)> (x: 'a) = x |> _.WhatANiceProperty " - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed [] let ``ToString with preview version`` () = Fsx "let myFunc = _.ToString()" - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -104,7 +104,7 @@ let ``Regression in neg typecheck hole as left arg`` () = let a = ( upcast _ ) : obj let b = ( _ :> _ ) : obj let c = ( _ :> obj) """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -135,7 +135,7 @@ let a5 : {| Foo : int -> {| X : string |} |} -> string = _.Foo(5).X open System let a6 = [1] |> List.map _.ToString() """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -145,7 +145,7 @@ let ``Nested anonymous unary function shorthands fails because of ambigous disca module One let a : string = {| Inner = (fun x -> x.ToString()) |} |> _.Inner([5] |> _.[0]) """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Warning 3570, Line 3, Col 75, Line 3, Col 76, "The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope.") @@ -158,7 +158,7 @@ let a : string -> string = (fun _ -> 5 |> _.ToString()) let b : int -> int -> string = function |5 -> (fun _ -> "Five") |_ -> _.ToString() let c : string = let _ = "test" in "asd" |> _.ToString() """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withSingleDiagnostic (Warning 3570, Line 3, Col 43, Line 3, Col 44, "The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope.") \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ExtensionMethodTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ExtensionMethodTests.fs index edae8eed826..817b33a43d6 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ExtensionMethodTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ExtensionMethodTests.fs @@ -19,7 +19,7 @@ type Foo = let f (b:int) = b.PlusOne() """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -35,7 +35,7 @@ type Foo = let f (b:int) = b.PlusOne() """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -73,7 +73,7 @@ and Bar = let f (b:int) = b.PlusOne() """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -90,7 +90,7 @@ type Foo = [] static member PlusOne (a:int) : int = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -172,7 +172,7 @@ and Bar = [] static member PlusOne (a:int) : int = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -210,7 +210,7 @@ module Foo = [] let PlusOne (a:int) : int = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -247,7 +247,7 @@ module Foo = [] let PlusOne (a:int) : int = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -281,7 +281,7 @@ namespace Consumer [] let PlusOne (a:int) = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -314,7 +314,7 @@ namespace Consumer [] let PlusOne (a:int) = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -348,7 +348,7 @@ namespace Consumer [] let PlusOne (a:int) = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -381,7 +381,7 @@ namespace Consumer [] let PlusOne (a:int) = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -416,7 +416,7 @@ type Bar = [] static member PlusOne (a:int) = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -449,7 +449,7 @@ type Bar = [] static member PlusOne (a:int) = a + 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = @@ -499,7 +499,7 @@ type Bar = [] static member PlusOne: a: int -> int """ - |> withLangVersionPreview + |> withLangVersion80 |> withAdditionalSourceFile implementation |> withName "FSLib" @@ -550,7 +550,7 @@ type Bar = [] static member PlusOne: a: int -> int """ - |> withLangVersionPreview + |> withLangVersion80 |> withAdditionalSourceFile implementation |> withName "FSLib" @@ -586,7 +586,7 @@ type Bar = [] let MinusOne (a:int) = a - 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> withName "FSLib" let csharp = diff --git a/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs index 09fca64fdab..d26727628b5 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs @@ -10,7 +10,7 @@ let ``Concrete instance method is not allowed in interfaces in lang preview``() type I = member _.X () = 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -24,7 +24,7 @@ let ``Concrete instance property is not allowed in interfaces in lang preview``( type I = member _.Prop = "x" """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnostics [ @@ -42,7 +42,7 @@ type I<'T> = if I.Echo 42 <> 42 || I.Prop <> 0 || not (isNull I.Prop) then failwith "failed" """ - |> withLangVersionPreview + |> withLangVersion80 |> asExe |> compileAndRun |> shouldSucceed @@ -79,7 +79,7 @@ let o = {{ new I with member _.Blah = 4 }} if I.Echo "yup" <> "yup" || (Imp() :> I).Blah <> 3 || o.Blah <> 4 then failwith "failed" """ - |> withLangVersionPreview + |> withLangVersion80 |> asExe |> compileAndRun |> shouldSucceed \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs index 16d70c1c154..c8f2eafa937 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs @@ -38,7 +38,7 @@ let c: System.IFormattable = $"string" let a = $"{{hello}} world" : System.FormattableString printf $"{a.Format}" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "{{hello}} world" @@ -49,7 +49,7 @@ printf $"{a.Format}" // printfn "%s" s Fsx "let s = $$\"\"\"{{42 + 0}} = {41 + 1}\"\"\"\n\ printfn \"%s\" s" - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "42 = {41 + 1}" @@ -58,7 +58,7 @@ printfn \"%s\" s" let ``Too many consecutive opening braces in interpolated string result in an error`` () = // $$"""{{{{42 - 0}}""" Fsx "$$\"\"\"{{{{42 - 0}}\"\"\"" - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withSingleDiagnostic (Error 1248, Line 1, Col 1, Line 1, Col 10, "The interpolated triple quoted string literal does not start with enough '$' characters to allow this many consecutive opening braces as content.") @@ -67,7 +67,7 @@ printfn \"%s\" s" let ``Too many consecutive closing braces in interpolated string result in an error`` () = // $$"""{{42 - 0}}}}""" Fsx "$$\"\"\"{{42 - 0}}}}\"\"\"" - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withSingleDiagnostic (Error 1249, Line 1, Col 15, Line 1, Col 21, "The interpolated string contains unmatched closing braces.") @@ -81,7 +81,7 @@ printfn \"%s\" s" [] let ``Double percent sign characters in triple quote interpolated strings`` () = Fsx "printfn \"%s\" $$$\"\"\"%%\"\"\"" - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "%%" @@ -89,7 +89,7 @@ printfn \"%s\" s" [] let ``Percent sign after interpolation hole in triple quote strings`` () = Fsx "printfn \"%s\" $$\"\"\"{{42}}%\"\"\"" - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "42%" @@ -97,7 +97,7 @@ printfn \"%s\" s" [] let ``Percent sign before format specifier in triple quote interpolated strings`` () = Fsx "printfn \"%s\" $$\"\"\"%%%3d{{42}}\"\"\"" - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "% 42" diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs index e25be0e550b..e3e54b0a957 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs @@ -124,8 +124,7 @@ if not((getData b) = re2.Data) then """ Fsx source |> asExe - |> withLangVersionPreview + |> withLangVersion80 |> ignoreWarnings |> compileAndRun |> shouldSucceed - diff --git a/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs index 90d76d2b335..b63ba3f53e1 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs @@ -20,7 +20,7 @@ module PrintfFormatTests let printLibraryVersion () = printfn Library.Version """ - |> withLangVersionPreview + |> withLangVersion80 |> withReferences [csLib] |> compile |> shouldSucceed @@ -36,7 +36,7 @@ let Format = "%d" if sprintf Format (Format.Length) <> "2" then failwith "failed" """ - |> withLangVersionPreview + |> withLangVersion80 |> asExe |> compileAndRun |> shouldSucceed @@ -51,7 +51,7 @@ let Format = "%s" let test = sprintf Format 42 """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withResult { diff --git a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs index 5fe944be088..4ad6a5cafe2 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs @@ -23,7 +23,7 @@ let rec f () = seq { yield! f() } """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> verifyIL [" .class auto ansi serializable sealed nested assembly beforefieldinit 'f@3-1' @@ -351,7 +351,7 @@ let typedSeq = |_ when x = 0 -> %s{valInWith2} }} """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -370,7 +370,7 @@ let typedSeq = |_ when x = 0 -> %s{valInWith2} }} """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed @@ -389,7 +389,7 @@ let typedSeq = |_ when x = 0 -> %s{valInWith2} }} """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withDiagnosticMessageMatches "This expression returns a value of type 'int' but is implicitly discarded." @@ -411,7 +411,7 @@ let typedSeq = |_ when x = 0 -> %s{valInWith2} }} """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withErrorCode 193 @@ -436,7 +436,7 @@ let typedSeq = |_ when x = 0 -> %s{valInWith2} }} """ - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldFail |> withErrorCode 30 diff --git a/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs index 7389bbdc697..6fc05018271 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs @@ -21,7 +21,7 @@ type T = class end [] type T = class end """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -31,7 +31,7 @@ type T = class end [] type T() = class end """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -51,7 +51,7 @@ type T() = class end [] type T(x: int) = class end """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -75,7 +75,7 @@ type T(x: int) = class end type T = new () = {} """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -100,7 +100,7 @@ type T = type T(x: int) = new () = T(42) """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -136,7 +136,7 @@ type ListDebugView<'T>(l: 'T list) = class end [] type ListDebugView<'T>(l: 'T list) = class end """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -152,7 +152,7 @@ type B = val mutable G : int new () = { F = 3; G = 3 } """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -162,8 +162,9 @@ type B = ] [] - [] [] + [] + [] let ``Mutually recursive type definition that using custom attributes``(langVersion) = let code = """ module Test @@ -225,7 +226,7 @@ type T() = member this.M() = () static member X = 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -252,7 +253,7 @@ type T() = static member M() = () static member X = T.M() """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -312,7 +313,7 @@ type C() = let a = 1 static let X = 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -327,7 +328,7 @@ type C() = let rec a = 1 static let X = 1 """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -342,7 +343,7 @@ type C() = static let a = 1 static let X = a """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -354,7 +355,7 @@ type C() = static let rec a = 1 static let X = a """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -399,7 +400,7 @@ type C() = interface MyInterface with member this.M() = () """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -417,7 +418,7 @@ type C = interface MyInterface with member this.M() = () """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -460,7 +461,7 @@ type T = abstract C : i:int -> int abstract D : i:int -> int """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -476,7 +477,7 @@ type T() = abstract C : i:int -> int abstract D : i:int -> int """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -526,7 +527,7 @@ type ConsoleRetriever = stdin.ReadLine() """ |> withNoWarn 3535 - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -549,7 +550,7 @@ type ConsoleRetriever() = stdin.ReadLine() """ |> withNoWarn 3535 - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -603,7 +604,7 @@ type T = static member Get() = T.F """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -621,7 +622,7 @@ type T() = static member Get() = T.F """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldSucceed @@ -661,7 +662,7 @@ type B = val F : int val mutable G : int """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -677,7 +678,7 @@ type B() = val F : int val mutable G : int """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -709,7 +710,7 @@ type T = member _.Item1 with set i value = () member _.Item2 with get i = 3 and set i value = () """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ @@ -760,7 +761,7 @@ type T = new () = { F = 3; G = 3 } new (x, y) = { F = x; G = y } """ - |> withLangVersionPreview + |> withLangVersion80 |> compile |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Language/WhileBangTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/WhileBangTests.fs index 724bebf887f..f619c3be742 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/WhileBangTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/WhileBangTests.fs @@ -27,7 +27,7 @@ module WhileBangTests = |> Async.RunSynchronously |> printfn "%d" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "12" @@ -60,7 +60,7 @@ module WhileBangTests = |> Async.RunSynchronously |> printfn "%d" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "30" @@ -94,7 +94,7 @@ module WhileBangTests = |> Async.RunSynchronously |> printfn "%d" """ - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "1" @@ -127,7 +127,7 @@ module WhileBangTests = |> printfn "%d" """ |> ignoreWarnings - |> withLangVersionPreview + |> withLangVersion80 |> compileExeAndRun |> shouldSucceed |> withStdOutContains "30" \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs index b0ff8e995c1..469f9fda0e7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs @@ -19,13 +19,13 @@ let ``Generate and compile`` implFileName = let generatedSignature = Fs implContents - |> withLangVersionPreview + |> withLangVersion80 |> withDefines ["TESTS_AS_APP";"COMPILED"] |> printSignatures Fsi generatedSignature |> withAdditionalSourceFile (FsSource implContents) - |> withLangVersionPreview + |> withLangVersion80 |> withDefines ["TESTS_AS_APP";"COMPILED"] |> ignoreWarnings |> withOptions [ "--warnaserror:64" ] diff --git a/tests/fsharp/Compiler/Regressions/NullableOptionalRegressionTests.fs b/tests/fsharp/Compiler/Regressions/NullableOptionalRegressionTests.fs index c4009ee5233..87f55ac4cce 100644 --- a/tests/fsharp/Compiler/Regressions/NullableOptionalRegressionTests.fs +++ b/tests/fsharp/Compiler/Regressions/NullableOptionalRegressionTests.fs @@ -50,7 +50,7 @@ type Test with static member nullable codec z = Test.nullableE(codec, z) """ FSharp fsSrc - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed |> ignore @@ -71,7 +71,7 @@ type Test with static member nullable codec = Test.nullableE codec """ FSharp fsSrc - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed |> ignore @@ -92,7 +92,7 @@ type Test with static member nullable codec = Test.nullableE codec """ FSharp fsSrc - |> withLangVersionPreview + |> withLangVersion80 |> typecheck |> shouldSucceed |> ignore From 70e6831d7868952f9f1123f397ac45e9598933fb Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 14 Aug 2023 14:29:00 +0200 Subject: [PATCH 02/18] Tests fixes --- .../FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs | 8 ++++---- .../Language/CopyAndUpdateTests.fs | 2 +- .../Language/DotLambdaTests.fs | 2 +- .../Language/InterfaceTests.fs | 2 +- .../Language/PrintfFormatTests.fs | 4 ++-- tests/fsharp/core/nameof/version46/test.fsx | 3 +-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs index 59a82186fc1..9ac49148a78 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs @@ -260,8 +260,8 @@ type E = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 6, Col 19, Line 6, Col 30, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 9, Col 23, Line 9, Col 37, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 12, Col 12, Line 12, Col 19, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 14, Col 12, Line 14, Col 21, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 19, Line 6, Col 30, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 8.0 or greater.") + (Error 3350, Line 9, Col 23, Line 9, Col 37, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 8.0 or greater.") + (Error 3350, Line 12, Col 12, Line 12, Col 19, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 8.0 or greater.") + (Error 3350, Line 14, Col 12, Line 14, Col 21, "Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 7.0. Please use language version 8.0 or greater.") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs index d02ec75cd9d..85f18b0bae3 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/CopyAndUpdateTests.fs @@ -33,7 +33,7 @@ let t2 x = { x with D.B = "a" } |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 6, Col 21, Line 6, Col 24, "Feature 'Nested record field copy-and-update' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 21, Line 6, Col 24, "Feature 'Nested record field copy-and-update' is not available in F# 7.0. Please use language version 8.0 or greater.") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs index fe0b2cad30b..578744ad479 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs @@ -120,7 +120,7 @@ let ``ToString with F# 7`` () = |> withLangVersion70 |> typecheck |> shouldFail - |> withSingleDiagnostic (Error 3350, Line 1, Col 16, Line 1, Col 18, "Feature 'underscore dot shorthand for accessor only function' is not available in F# 7.0. Please use language version 'PREVIEW' or greater." ) + |> withSingleDiagnostic (Error 3350, Line 1, Col 16, Line 1, Col 18, "Feature 'underscore dot shorthand for accessor only function' is not available in F# 7.0. Please use language version 8.0 or greater." ) [] let ``Simple anonymous unary function shorthands compile`` () = diff --git a/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs index d26727628b5..4bfda202bbf 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/InterfaceTests.fs @@ -59,7 +59,7 @@ type I<'T> = |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3350, Line 4, Col 19, Line 4, Col 23, "Feature 'Static members in interfaces' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 4, Col 19, Line 4, Col 23, "Feature 'Static members in interfaces' is not available in F# 7.0. Please use language version 8.0 or greater.") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs index b63ba3f53e1..8f04c09996a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/PrintfFormatTests.fs @@ -90,6 +90,6 @@ let bad2 = sprintf Library.Version |> compile |> shouldFail |> withDiagnostics [ - (Error 3350, Line 7, Col 20, Line 7, Col 26, "Feature 'String values marked as literals and IL constants as printf format' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") - (Error 3350, Line 9, Col 20, Line 9, Col 35, "Feature 'String values marked as literals and IL constants as printf format' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 7, Col 20, Line 7, Col 26, "Feature 'String values marked as literals and IL constants as printf format' is not available in F# 7.0. Please use language version 8.0 or greater.") + (Error 3350, Line 9, Col 20, Line 9, Col 35, "Feature 'String values marked as literals and IL constants as printf format' is not available in F# 7.0. Please use language version 8.0 or greater.") ] \ No newline at end of file diff --git a/tests/fsharp/core/nameof/version46/test.fsx b/tests/fsharp/core/nameof/version46/test.fsx index 0652ca028eb..22aea14f54d 100644 --- a/tests/fsharp/core/nameof/version46/test.fsx +++ b/tests/fsharp/core/nameof/version46/test.fsx @@ -32,7 +32,7 @@ //The value or constructor 'nameof' is not defined. //The value or constructor 'nameof' is not defined. //This is not a valid constant expression or custom attribute value -//Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 4.6. Please use language version 'PREVIEW' or greater. +//Feature 'Arithmetic and logical operations in literals, enum definitions and attributes' is not available in F# 4.6. Please use language version 8.0 or greater. //The value or constructor 'nameof' is not defined. //This is not a valid constant expression or custom attribute value //This is not a valid constant expression or custom attribute value @@ -340,4 +340,3 @@ type Person = module Foo = let nameof = () let x = name () - From 34a99a1a9472e56f2d37374b56fe0ec1cae5622b Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 11:20:17 +0200 Subject: [PATCH 03/18] Tests fixes --- .../PermittedLocations/PermittedLocations.fs | 4 +- .../LetBindings/Basic/Basic.fs | 2 +- .../Types/RecordTypes/RecordTypes.fs | 1 + .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 2 +- .../Types/UnionTypes/UnionTypes.fs | 3 +- .../ObsoleteAttributeCheckingTests.fs | 2 + .../Miscellaneous/FsharpSuiteMigrated.fs | 1 + tests/FSharp.Test.Utilities/ScriptHelpers.fs | 2 + .../Language/SpanOptimizationTests.fs | 12 +++--- tests/fsharp/core/members/ctree/test.fsx | 41 +++++++++---------- tests/fsharp/tests.fs | 4 +- 11 files changed, 39 insertions(+), 35 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/PermittedLocations/PermittedLocations.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/PermittedLocations/PermittedLocations.fs index f76cbdb9dea..0e8a66efdf0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/PermittedLocations/PermittedLocations.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/PermittedLocations/PermittedLocations.fs @@ -125,9 +125,9 @@ module AccessibilityAnnotations_PermittedLocations = |> shouldFail |> withDiagnostics [ (Error 531, Line 11, Col 13, Line 11, Col 20, "Accessibility modifiers should come immediately prior to the identifier naming a construct") - (Warning 58, Line 12, Col 23, Line 12, Col 26, "Possible incorrect indentation: this token is offside of context started at position (11:23). Try indenting this token further or using standard formatting conventions.") + (Error 58, Line 12, Col 23, Line 12, Col 26, "Possible incorrect indentation: this token is offside of context started at position (11:23). Try indenting this token further or using standard formatting conventions.") (Error 531, Line 12, Col 13, Line 12, Col 19, "Accessibility modifiers should come immediately prior to the identifier naming a construct") - (Warning 58, Line 13, Col 23, Line 13, Col 26, "Possible incorrect indentation: this token is offside of context started at position (12:23). Try indenting this token further or using standard formatting conventions.") + (Error 58, Line 13, Col 23, Line 13, Col 26, "Possible incorrect indentation: this token is offside of context started at position (12:23). Try indenting this token further or using standard formatting conventions.") (Error 531, Line 13, Col 13, Line 13, Col 21, "Accessibility modifiers should come immediately prior to the identifier naming a construct") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs index 33eff4235d1..ea00b30e1be 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs @@ -76,7 +76,7 @@ module LetBindings_Basic = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Warning 58, Line 10, Col 1, Line 10, Col 5, "Possible incorrect indentation: this token is offside of context started at position (8:1). Try indenting this token further or using standard formatting conventions.") + (Error 58, Line 10, Col 1, Line 10, Col 5, "Possible incorrect indentation: this token is offside of context started at position (8:1). Try indenting this token further or using standard formatting conventions.") (Error 10, Line 10, Col 6, Line 10, Col 7, "Unexpected start of structured construct in expression") (Error 583, Line 9, Col 5, Line 9, Col 6, "Unmatched '('") (Error 10, Line 10, Col 16, Line 10, Col 17, "Unexpected symbol ')' in implementation file") diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs index 241e834c8fe..ef86ec93da2 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs @@ -11,6 +11,7 @@ module RecordTypes = let verifyTypeCheckAsFsxAsLibrary compilation = compilation |> asLibrary + |> withOptions ["--nowarn:3560"] |> typecheck |> 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 f82da4d8d80..63c78877f81 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -60,7 +60,7 @@ let main _ = let ``IWSAM test files`` compilation = compilation |> setupCompilation - |> withLangVersion80 + |> withLangVersionPreview |> compileAndRun |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs index bc5f4e9d8c8..555d1b42f15 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs @@ -595,7 +595,7 @@ module UnionTypes = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Warning 58, Line 9, Col 1, Line 9, Col 2, "Possible incorrect indentation: this token is offside of context started at position (8:19). Try indenting this token further or using standard formatting conventions.") + (Error 58, Line 9, Col 1, Line 9, Col 2, "Possible incorrect indentation: this token is offside of context started at position (8:19). Try indenting this token further or using standard formatting conventions.") ] //SOURCE=W_UnionCaseProduction01.fsx SCFLAGS="-a --test:ErrorRanges" # W_UnionCaseProduction01.fsx @@ -607,4 +607,3 @@ module UnionTypes = |> withDiagnostics [ (Warning 42, Line 11, Col 12, Line 11, Col 24, "This construct is deprecated: it is only for use in the F# library") ] - diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs index 8fc365cd172..d503daa77e0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs @@ -347,6 +347,7 @@ type ButtonExtensions = { this with Text = text } """ |> ignoreWarnings + |> withOptions ["--nowarn:3560"] |> compile |> shouldFail |> withDiagnostics [ @@ -590,6 +591,7 @@ let b = { Text = "Hello" } b.text("Hello 2") |> ignore """ |> ignoreWarnings + |> withOptions ["--nowarn:3560"] |> compile |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs index 72af2260eb6..79f3b1fc25e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs @@ -79,6 +79,7 @@ module TestFrameworkAdapter = | LangVersion.V50 -> "5.0",bonusArgs | LangVersion.V60 -> "6.0",bonusArgs | LangVersion.V70 -> "7.0",bonusArgs + | LangVersion.V80 -> "8.0",bonusArgs | LangVersion.Preview -> "preview",bonusArgs | LangVersion.Latest -> "latest", bonusArgs | LangVersion.SupportsMl -> "5.0", "--mlcompatibility" :: bonusArgs diff --git a/tests/FSharp.Test.Utilities/ScriptHelpers.fs b/tests/FSharp.Test.Utilities/ScriptHelpers.fs index 9fc02830dac..204168f5df2 100644 --- a/tests/FSharp.Test.Utilities/ScriptHelpers.fs +++ b/tests/FSharp.Test.Utilities/ScriptHelpers.fs @@ -19,6 +19,7 @@ type LangVersion = | V50 | V60 | V70 + | V80 | Preview | Latest | SupportsMl @@ -46,6 +47,7 @@ type FSharpScript(?additionalArgs: string[], ?quiet: bool, ?langVersion: LangVer | LangVersion.Latest -> "--langversion:latest" | LangVersion.V60 -> "--langversion:6.0" | LangVersion.V70 -> "--langversion:7.0" + | LangVersion.V80 -> "--langversion:8.0" |] let argv = Array.append baseArgs additionalArgs diff --git a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs index 49f356d3e0c..3ac380941fa 100644 --- a/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs +++ b/tests/fsharp/Compiler/Language/SpanOptimizationTests.fs @@ -212,9 +212,9 @@ module Test open System let test () = -let span = Span.Empty -for i in 0 .. span.Length-1 do - Console.WriteLine(span.[i]) + let span = Span.Empty + for i in 0 .. span.Length-1 do + Console.WriteLine(span.[i]) """ CompilerAssert.CompileLibraryAndVerifyIL( @@ -263,9 +263,9 @@ module Test open System let test () = -let span = ReadOnlySpan.Empty -for i in 0 .. span.Length-1 do -Console.WriteLine(span.[i]) + let span = ReadOnlySpan.Empty + for i in 0 .. span.Length-1 do + Console.WriteLine(span.[i]) """ CompilerAssert.CompileLibraryAndVerifyIL( diff --git a/tests/fsharp/core/members/ctree/test.fsx b/tests/fsharp/core/members/ctree/test.fsx index 376e5b1a707..117a36d1c18 100644 --- a/tests/fsharp/core/members/ctree/test.fsx +++ b/tests/fsharp/core/members/ctree/test.fsx @@ -19,19 +19,19 @@ let check s b1 b2 = test s (b1 = b2) module CTree1 = begin -type 'a ctree = - class - val isLeaf: bool - val leafVal: 'a option - val children: 'a ctree list + type 'a ctree = + class + val isLeaf: bool + val leafVal: 'a option + val children: 'a ctree list - new(x : 'a) = { isLeaf = true; leafVal = Some(x); children = [] } - - new((dummy : bool) , (l : 'a ctree list)) = { isLeaf = false; leafVal = None; children = l } + new(x : 'a) = { isLeaf = true; leafVal = Some(x); children = [] } + + new((dummy : bool) , (l : 'a ctree list)) = { isLeaf = false; leafVal = None; children = l } - static member MkNode(l : 'a ctree list) = new ctree<_>(true, l) + static member MkNode(l : 'a ctree list) = new ctree<_>(true, l) - end + end end @@ -40,19 +40,19 @@ module CTree2 = begin -type 'a ctree = - class - val isLeaf: bool - val leafVal: 'a option - val children: 'a ctree list + type 'a ctree = + class + val isLeaf: bool + val leafVal: 'a option + val children: 'a ctree list - new(x : 'a) = { isLeaf = true; leafVal = Some(x); children = [] } - - new((dummy : bool) , (l : 'a ctree list)) = { isLeaf = false; leafVal = None; children = l } + new(x : 'a) = { isLeaf = true; leafVal = Some(x); children = [] } + + new((dummy : bool) , (l : 'a ctree list)) = { isLeaf = false; leafVal = None; children = l } - static member MkNode(l : 'a ctree list) = new ctree<_>(true, l) + static member MkNode(l : 'a ctree list) = new ctree<_>(true, l) - end + end end @@ -70,4 +70,3 @@ let aa = stdout.WriteLine "Test Failed" exit 1 #endif - diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index f2aaad809cc..269d98ba77a 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1663,13 +1663,13 @@ module VersionTests = let ``member-selfidentifier-version4_6``() = singleTestBuildAndRunVersion "core/members/self-identifier/version46" (FSC_BUILDONLY true) "4.6" [] - let ``member-selfidentifier-version4_7``() = singleTestBuildAndRun "core/members/self-identifier/version47" (FSC_BUILDONLY true) + let ``member-selfidentifier-version4_7``() = singleTestBuildAndRunVersion "core/members/self-identifier/version47" (FSC_BUILDONLY true) "4.7" [] let ``indent-version4_6``() = singleTestBuildAndRunVersion "core/indent/version46" (FSC_BUILDONLY true) "4.6" [] - let ``indent-version4_7``() = singleTestBuildAndRun "core/indent/version47" (FSC_BUILDONLY true) + let ``indent-version4_7``() = singleTestBuildAndRunVersion "core/indent/version47" (FSC_BUILDONLY true) "4.7" [] let ``nameof-version4_6``() = singleTestBuildAndRunVersion "core/nameof/version46" (FSC_BUILDONLY true) "4.6" From 3b4ac39c88d9f37269fd93b6cfcff7c2164061fd Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 12:09:39 +0200 Subject: [PATCH 04/18] Tests fixes --- .../OffsideExceptions/OffsideExceptions.fs | 2 +- .../Types/UnionTypes/UnionTypes.fs | 2 ++ .../Language/FixedBindings/FixedBindings.fs | 24 +++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs index bfd20903018..3dd4b360463 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs @@ -262,7 +262,7 @@ module A |> typecheck |> shouldFail |> withResult { - Error = Warning 58 + Error = Error 58 Range = { StartLine = 4 StartColumn = 5 EndLine = 4 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs index 555d1b42f15..f66c21b13c3 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionTypes.fs @@ -596,6 +596,8 @@ module UnionTypes = |> shouldFail |> withDiagnostics [ (Error 58, Line 9, Col 1, Line 9, Col 2, "Possible incorrect indentation: this token is offside of context started at position (8:19). Try indenting this token further or using standard formatting conventions.") + (Error 547, Line 8, Col 24, Line 8, Col 33, "A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'.") + (Error 10, Line 9, Col 1, Line 9, Col 2, "Unexpected symbol '|' in implementation file") ] //SOURCE=W_UnionCaseProduction01.fsx SCFLAGS="-a --test:ErrorRanges" # W_UnionCaseProduction01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs b/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs index 86fb0c6c641..a99df0176e9 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs @@ -223,7 +223,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 5, Col 9, Line 5, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 5, Col 9, Line 5, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 5, Col 9, Line 5, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 6, Col 5, Line 6, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -237,7 +237,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 5, Col 9, Line 5, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 5, Col 9, Line 5, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 5, Col 9, Line 5, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 6, Col 5, Line 6, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -251,7 +251,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 5, Col 9, Line 5, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 5, Col 9, Line 5, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 5, Col 9, Line 5, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 6, Col 5, Line 6, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -267,7 +267,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 8, Col 13, Line 8, Col 16, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 8, Col 13, Line 8, Col 16, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 8, Col 13, Line 8, Col 16, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 9, Col 9, Line 9, Col 22, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -281,7 +281,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 6, Col 9, Line 6, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 6, Col 9, Line 6, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 6, Col 9, Line 6, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 7, Col 5, Line 7, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -296,7 +296,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 6, Col 9, Line 6, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 6, Col 9, Line 6, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 6, Col 9, Line 6, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 7, Col 5, Line 7, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] #endif @@ -324,7 +324,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 9, Col 9, Line 9, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 9, Col 9, Line 9, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 9, Col 9, Line 9, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 10, Col 5, Line 10, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -338,7 +338,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 9, Col 9, Line 9, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 9, Col 9, Line 9, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 9, Col 9, Line 9, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 10, Col 5, Line 10, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -352,7 +352,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 13, Col 9, Line 13, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 13, Col 9, Line 13, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 13, Col 9, Line 13, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 14, Col 5, Line 14, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -392,7 +392,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 11, Col 9, Line 11, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 11, Col 9, Line 11, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 11, Col 9, Line 11, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 12, Col 5, Line 12, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] @@ -431,7 +431,7 @@ The type 'char' does not match the type 'byte'""") |> shouldFail |> withDiagnostics [ (Warning 9, Line 9, Col 9, Line 9, Col 31, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 9, Col 9, Line 9, Col 31, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 9, Col 9, Line 9, Col 31, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Error 1, Line 9, Col 9, Line 9, Col 31, "Type mismatch. Expecting a 'nativeptr' but given a @@ -448,7 +448,7 @@ The type 'int' does not match the type 'char'") |> shouldFail |> withDiagnostics [ (Warning 9, Line 13, Col 9, Line 13, Col 12, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") - (Error 3350, Line 13, Col 9, Line 13, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 'PREVIEW' or greater.""") + (Error 3350, Line 13, Col 9, Line 13, Col 12, """Feature 'extended fixed bindings for byref and GetPinnableReference' is not available in F# 7.0. Please use language version 8.0 or greater.""") (Warning 9, Line 14, Col 5, Line 14, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] From 67a750f21a7c4d7b3a59c1e86195b6c1cb348df9 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 12:37:40 +0200 Subject: [PATCH 05/18] Tests fixes --- tests/fsharp/core/quotes/test.fsx | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index cc85cf23ad6..eb5151c4e66 100644 --- a/tests/fsharp/core/quotes/test.fsx +++ b/tests/fsharp/core/quotes/test.fsx @@ -1669,10 +1669,10 @@ module MoreQuotationsTests = let _ = <@@ v.ExtensionMethod0 @@> |> checkQuoteString "fqekhec16" """Lambda (unitVar, Call (None, Object.ExtensionMethod0, [PropertyGet (None, v, [])]))""" let _ = <@@ v.ExtensionMethod1 @@> |> checkQuoteString "fqekhec17" """Lambda (unitVar, Call (None, Object.ExtensionMethod1, [PropertyGet (None, v, [])]))""" - let _ = <@@ v.ExtensionMethod2 @@> |> checkQuoteString "fqekhec18" """Lambda (arg00, Call (None, Object.ExtensionMethod2, [PropertyGet (None, v, []), arg00]))""" - let _ = <@@ v.ExtensionMethod3 @@> |> checkQuoteString "fqekhec19" """Lambda (arg00, Call (None, Object.ExtensionMethod3, [PropertyGet (None, v, []), arg00]))""" - let _ = <@@ v.ExtensionMethod4 @@> |> checkQuoteString "fqekhec20" """Lambda (tupledArg, Let (arg00, TupleGet (tupledArg, 0), Let (arg01, TupleGet (tupledArg, 1), Call (None, Object.ExtensionMethod4, [PropertyGet (None, v, []), arg00, arg01]))))""" - let _ = <@@ v.ExtensionMethod5 @@> |> checkQuoteString "fqekhec21" """Lambda (arg00, Call (None, Object.ExtensionMethod5, [PropertyGet (None, v, []), arg00]))""" + let _ = <@@ v.ExtensionMethod2 @@> |> checkQuoteString "fqekhec18" """Lambda (y, Call (None, Object.ExtensionMethod2, [PropertyGet (None, v, []), y]))""" + let _ = <@@ v.ExtensionMethod3 @@> |> checkQuoteString "fqekhec19" """Lambda (y, Call (None, Object.ExtensionMethod3, [PropertyGet (None, v, []), y]))""" + let _ = <@@ v.ExtensionMethod4 @@> |> checkQuoteString "fqekhec20" """Lambda (tupledArg, Let (y, TupleGet (tupledArg, 0), Let (z, TupleGet (tupledArg, 1), Call (None, Object.ExtensionMethod4, [PropertyGet (None, v, []), y, z]))))""" + let _ = <@@ v.ExtensionMethod5 @@> |> checkQuoteString "fqekhec21" """Lambda (y, Call (None, Object.ExtensionMethod5, [PropertyGet (None, v, []), y]))""" let v2 = 3 let _ = <@@ v2.ExtensionMethod0() @@> |> checkQuoteString "fqekhec22" """Call (None, Object.ExtensionMethod0, [Coerce (PropertyGet (None, v2, []), Object)])""" @@ -1689,10 +1689,10 @@ module MoreQuotationsTests = let _ = <@@ v2.ExtensionMethod0 @@> |> checkQuoteString "fqekhec33" """Lambda (unitVar, Call (None, Object.ExtensionMethod0, [Coerce (PropertyGet (None, v2, []), Object)]))""" let _ = <@@ v2.ExtensionMethod1 @@> |> checkQuoteString "fqekhec34" """Lambda (unitVar, Call (None, Object.ExtensionMethod1, [Coerce (PropertyGet (None, v2, []), Object)]))""" - let _ = <@@ v2.ExtensionMethod2 @@> |> checkQuoteString "fqekhec35" """Lambda (arg00, Call (None, Object.ExtensionMethod2, [Coerce (PropertyGet (None, v2, []), Object), arg00]))""" - let _ = <@@ v2.ExtensionMethod3 @@> |> checkQuoteString "fqekhec36" """Lambda (arg00, Call (None, Object.ExtensionMethod3, [Coerce (PropertyGet (None, v2, []), Object), arg00]))""" - let _ = <@@ v2.ExtensionMethod4 @@> |> checkQuoteString "fqekhec37" """Lambda (tupledArg, Let (arg00, TupleGet (tupledArg, 0), Let (arg01, TupleGet (tupledArg, 1), Call (None, Object.ExtensionMethod4, [Coerce (PropertyGet (None, v2, []), Object), arg00, arg01]))))""" - let _ = <@@ v2.ExtensionMethod5 @@> |> checkQuoteString "fqekhec38" """Lambda (arg00, Call (None, Object.ExtensionMethod5, [Coerce (PropertyGet (None, v2, []), Object), arg00]))""" + let _ = <@@ v2.ExtensionMethod2 @@> |> checkQuoteString "fqekhec35" """Lambda (y, Call (None, Object.ExtensionMethod2, [Coerce (PropertyGet (None, v2, []), Object), y]))""" + let _ = <@@ v2.ExtensionMethod3 @@> |> checkQuoteString "fqekhec36" """Lambda (y, Call (None, Object.ExtensionMethod3, [Coerce (PropertyGet (None, v2, []), Object), y]))""" + let _ = <@@ v2.ExtensionMethod4 @@> |> checkQuoteString "fqekhec37" """Lambda (tupledArg, Let (y, TupleGet (tupledArg, 0), Let (z, TupleGet (tupledArg, 1), Call (None, Object.ExtensionMethod4, [Coerce (PropertyGet (None, v2, []), Object), y, z]))))""" + let _ = <@@ v2.ExtensionMethod5 @@> |> checkQuoteString "fqekhec38" """Lambda (y, Call (None, Object.ExtensionMethod5, [Coerce (PropertyGet (None, v2, []), Object), y]))""" let _ = <@@ v2.Int32ExtensionMethod0() @@> |> checkQuoteString "fqekhec39" """Call (None, Int32.Int32ExtensionMethod0, [PropertyGet (None, v2, [])])""" let _ = <@@ v2.Int32ExtensionMethod1() @@> |> checkQuoteString "fqekhec40" """Call (None, Int32.Int32ExtensionMethod1, [PropertyGet (None, v2, [])])""" @@ -1708,10 +1708,10 @@ module MoreQuotationsTests = let _ = <@@ v2.Int32ExtensionMethod0 @@> |> checkQuoteString "fqekhec50" """Lambda (unitVar, Call (None, Int32.Int32ExtensionMethod0, [PropertyGet (None, v2, [])]))""" let _ = <@@ v2.Int32ExtensionMethod1 @@> |> checkQuoteString "fqekhec51" """Lambda (unitVar, Call (None, Int32.Int32ExtensionMethod1, [PropertyGet (None, v2, [])]))""" - let _ = <@@ v2.Int32ExtensionMethod2 @@> |> checkQuoteString "fqekhec52" """Lambda (arg00, Call (None, Int32.Int32ExtensionMethod2, [PropertyGet (None, v2, []), arg00]))""" - let _ = <@@ v2.Int32ExtensionMethod3 @@> |> checkQuoteString "fqekhec53" """Lambda (arg00, Call (None, Int32.Int32ExtensionMethod3, [PropertyGet (None, v2, []), arg00]))""" - let _ = <@@ v2.Int32ExtensionMethod4 @@> |> checkQuoteString "fqekhec54" """Lambda (tupledArg, Let (arg00, TupleGet (tupledArg, 0), Let (arg01, TupleGet (tupledArg, 1), Call (None, Int32.Int32ExtensionMethod4, [PropertyGet (None, v2, []), arg00, arg01]))))""" - let _ = <@@ v2.Int32ExtensionMethod5 @@> |> checkQuoteString "fqekhec55" """Lambda (arg00, Call (None, Int32.Int32ExtensionMethod5, [PropertyGet (None, v2, []), arg00]))""" + let _ = <@@ v2.Int32ExtensionMethod2 @@> |> checkQuoteString "fqekhec52" """Lambda (y, Call (None, Int32.Int32ExtensionMethod2, [PropertyGet (None, v2, []), y]))""" + let _ = <@@ v2.Int32ExtensionMethod3 @@> |> checkQuoteString "fqekhec53" """Lambda (y, Call (None, Int32.Int32ExtensionMethod3, [PropertyGet (None, v2, []), y]))""" + let _ = <@@ v2.Int32ExtensionMethod4 @@> |> checkQuoteString "fqekhec54" """Lambda (tupledArg, Let (y, TupleGet (tupledArg, 0), Let (z, TupleGet (tupledArg, 1), Call (None, Int32.Int32ExtensionMethod4, [PropertyGet (None, v2, []), y, z]))))""" + let _ = <@@ v2.Int32ExtensionMethod5 @@> |> checkQuoteString "fqekhec55" """Lambda (y, Call (None, Int32.Int32ExtensionMethod5, [PropertyGet (None, v2, []), y]))""" module QuotationConstructionTests = @@ -5944,4 +5944,3 @@ let aa = printfn "Test Failed, errors = %A" errs exit 1 #endif - From eb894654793e6e0d7a9364b6f68857f65e843d18 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 12:45:57 +0200 Subject: [PATCH 06/18] Tests fixes --- .../EmittedIL/TestFunctions/TestFunctions.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs index 7e80b1e622b..4b976530e9e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs @@ -252,6 +252,7 @@ module TestFunctions = [] let ``TestFunction24_fs`` compilation = compilation + |> withLangVersion70 |> verifyCompilation // Verify IL 13043 From dd7a43e8796ad5f7068cd9c4fd10706bd4809b35 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 13:07:28 +0200 Subject: [PATCH 07/18] Tests fixes --- 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 c5ab25e3857..0cc5370d570 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -178,13 +178,13 @@ type LanguageVersion(versionText) = LanguageFeature.StaticLetInRecordsDusEmptyTypes, languageVersion80 LanguageFeature.StrictIndentation, languageVersion80 LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80 - LanguageFeature.UnmanagedConstraintCsharpInterop, languageVersion80 LanguageFeature.WhileBang, languageVersion80 LanguageFeature.ExtendedFixedBindings, languageVersion80 LanguageFeature.PreferStringGetPinnableReference, languageVersion80 // F# preview LanguageFeature.FromEndSlicing, previewVersion + LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") From 32ff979136ba4462d83b67bd73f6e55e76e1bd98 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 13:35:20 +0200 Subject: [PATCH 08/18] Final (?) tests fixes --- .../Conformance/Constraints/Unmanaged.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs index 514e2023f2e..d75e803273b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs @@ -361,7 +361,7 @@ let _ = Test>>() [] let ``Multi constraint IL test together with struct and interface constraints`` () = Fsx "[] type Test<'T when 'T: unmanaged and 'T: struct and 'T:>System.IComparable> = struct end" - |> withLangVersion80 + |> withLangVersionPreview |> compile |> shouldSucceed |> verifyIL [""" @@ -387,7 +387,7 @@ let _ = Test>>() [] let ``IsUnmanagedAttribute Attribute is emitted for function with unmanaged constraint`` () = Fsx "let testMyFunction (x: 'TUnmanaged when 'TUnmanaged : unmanaged) = struct(x,1)" - |> withLangVersion80 + |> withLangVersionPreview |> compile |> shouldSucceed |> verifyIL [""" @@ -458,7 +458,7 @@ printf "%s" (CsharpStruct.Hi()) [] let ``FSharp generates modreq for CSharp to consume in preview`` () = Fsx "let testMyFunction (x: 'TUnmanaged when 'TUnmanaged : unmanaged) = ()" - |> withLangVersion80 + |> withLangVersionPreview |> compile |> shouldSucceed |> verifyIL [""" @@ -495,7 +495,7 @@ type FsharpStructWrapper<'TInner when 'TInner: unmanaged> = val Item : 'TInner with static member Hi() = typeof<'TInner>.Name""" |> asLibrary - |> withLangVersion80 + |> withLangVersionPreview |> withName "fsLib" let app = From 8f88d616431c3f9a932b0bfcd6ca7a5991023a23 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 14:16:07 +0200 Subject: [PATCH 09/18] Final (?) tests fixes #2 --- .../Conformance/Constraints/Unmanaged.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs index d75e803273b..085027df320 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs @@ -541,7 +541,7 @@ module FsharpPreparedData = let structDuExample2 = B "42" """ |> asLibrary - |> withLangVersion80 + |> withLangVersionPreview |> withName "fsLib" let app = From bf0b1e9cc4e43140809456cfc43ccdd7a77f3951 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 15:21:38 +0200 Subject: [PATCH 10/18] Final (?) tests fixes #3 --- tests/fsharp/typecheck/sigs/neg62.bsl | 6 --- tests/fsharp/typecheck/sigs/neg74.bsl | 54 +-------------------------- tests/fsharp/typecheck/sigs/neg75.bsl | 8 +--- tests/fsharp/typecheck/sigs/neg76.bsl | 8 +--- tests/fsharp/typecheck/sigs/neg77.bsl | 4 +- tests/fsharp/typecheck/sigs/neg81.bsl | 10 ----- 6 files changed, 4 insertions(+), 86 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg62.bsl b/tests/fsharp/typecheck/sigs/neg62.bsl index a0f2b8cef29..125ef87d66b 100644 --- a/tests/fsharp/typecheck/sigs/neg62.bsl +++ b/tests/fsharp/typecheck/sigs/neg62.bsl @@ -1,8 +1,4 @@ -neg62.fs(5,3,5,28): typecheck error FS0902: For F#7 and lower, static value definitions may only be used in types with a primary constructor ('type X(args) = ...'). To enable them in all other types, use language version 'preview'. - -neg62.fs(8,3,8,19): typecheck error FS0902: For F#7 and lower, static value definitions may only be used in types with a primary constructor ('type X(args) = ...'). To enable them in all other types, use language version 'preview'. - neg62.fs(11,3,11,12): typecheck error FS0963: This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. neg62.fs(14,3,14,21): typecheck error FS0963: This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. @@ -17,8 +13,6 @@ neg62.fs(28,5,28,18): typecheck error FS0960: 'let' and 'do' bindings must come neg62.fs(31,5,31,32): typecheck error FS3133: 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. -neg62.fs(31,5,31,32): typecheck error FS0902: For F#7 and lower, static value definitions may only be used in types with a primary constructor ('type X(args) = ...'). To enable them in all other types, use language version 'preview'. - neg62.fs(34,5,34,25): typecheck error FS3133: 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. neg62.fs(49,6,49,26): typecheck error FS0081: Implicit object constructors for structs must take at least one argument diff --git a/tests/fsharp/typecheck/sigs/neg74.bsl b/tests/fsharp/typecheck/sigs/neg74.bsl index 2a3f2816a0a..75fe17547b8 100644 --- a/tests/fsharp/typecheck/sigs/neg74.bsl +++ b/tests/fsharp/typecheck/sigs/neg74.bsl @@ -1,56 +1,4 @@ neg74.fsx(185,1,185,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. -neg74.fsx(185,1,185,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(194,1,194,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(194,1,194,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(203,1,203,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(203,1,203,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(212,1,212,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(212,1,212,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(221,1,221,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(221,1,221,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(230,1,230,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(230,1,230,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(231,1,231,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(231,1,231,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(232,1,232,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(232,1,232,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(233,1,233,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(233,1,233,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(234,1,234,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(234,1,234,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(236,1,236,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(236,1,236,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0010: Unexpected symbol '[<' in binding. Expected incomplete structured construct at or before this point or other token. - -neg74.fsx(242,1,242,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(242,1,242,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(254,1,254,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file +neg74.fsx(183,52,183,53): parse error FS3156: Unexpected token '+' or incomplete expression diff --git a/tests/fsharp/typecheck/sigs/neg75.bsl b/tests/fsharp/typecheck/sigs/neg75.bsl index b46bf301d19..2ce481d92dd 100644 --- a/tests/fsharp/typecheck/sigs/neg75.bsl +++ b/tests/fsharp/typecheck/sigs/neg75.bsl @@ -1,10 +1,4 @@ neg75.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. -neg75.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(153,24,153,27): parse error FS0588: The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. +neg75.fsx(153,79,153,80): parse error FS3156: Unexpected token '+' or incomplete expression diff --git a/tests/fsharp/typecheck/sigs/neg76.bsl b/tests/fsharp/typecheck/sigs/neg76.bsl index e5d4673dfc2..00657dfc934 100644 --- a/tests/fsharp/typecheck/sigs/neg76.bsl +++ b/tests/fsharp/typecheck/sigs/neg76.bsl @@ -1,10 +1,4 @@ neg76.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. -neg76.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(153,24,153,27): parse error FS0588: The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. +neg76.fsx(153,79,153,80): parse error FS3156: Unexpected token '*' or incomplete expression diff --git a/tests/fsharp/typecheck/sigs/neg77.bsl b/tests/fsharp/typecheck/sigs/neg77.bsl index 922e6b66950..fabc3b04188 100644 --- a/tests/fsharp/typecheck/sigs/neg77.bsl +++ b/tests/fsharp/typecheck/sigs/neg77.bsl @@ -1,6 +1,4 @@ neg77.fsx(134,15,134,16): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (133:19). Try indenting this token further or using standard formatting conventions. -neg77.fsx(134,15,134,16): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (133:19). Try indenting this token further or using standard formatting conventions. - -neg77.fsx(134,15,134,16): parse error FS0010: Unexpected symbol '|' in expression +neg77.fsx(134,15,134,16): parse error FS0010: Incomplete structured construct at or before this point in expression diff --git a/tests/fsharp/typecheck/sigs/neg81.bsl b/tests/fsharp/typecheck/sigs/neg81.bsl index fae282eb3e2..7913d5b7ea4 100644 --- a/tests/fsharp/typecheck/sigs/neg81.bsl +++ b/tests/fsharp/typecheck/sigs/neg81.bsl @@ -1,14 +1,4 @@ neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:5). Try indenting this token further or using standard formatting conventions. -neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:5). Try indenting this token further or using standard formatting conventions. - -neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (5:1). Try indenting this token further or using standard formatting conventions. - neg81.fsx(6,6,6,7): parse error FS3156: Unexpected token '+' or incomplete expression - -neg81.fsx(8,1,8,5): parse error FS0010: Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. - -neg81.fsx(5,1,5,4): parse error FS3118: Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. - -neg81.fsx(10,1,10,1): parse error FS0010: Incomplete structured construct at or before this point in definition. Expected incomplete structured construct at or before this point or other token. From af3bf1bb8cd1a323f8c8abe52b79ee352bfda286 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 16 Aug 2023 16:02:40 +0200 Subject: [PATCH 11/18] Final (?) tests fixes #4 --- tests/service/PatternMatchCompilationTests.fs | 2 +- tests/service/ServiceUntypedParseTests.fs | 2 +- .../Tests.LanguageService.Completion.fs | 2 +- .../Tests.LanguageService.ErrorList.fs | 22 ++----------------- .../Tests.LanguageService.ParameterInfo.fs | 4 ++-- 5 files changed, 7 insertions(+), 25 deletions(-) diff --git a/tests/service/PatternMatchCompilationTests.fs b/tests/service/PatternMatchCompilationTests.fs index de62e4d3377..0d575ee35de 100644 --- a/tests/service/PatternMatchCompilationTests.fs +++ b/tests/service/PatternMatchCompilationTests.fs @@ -134,7 +134,7 @@ match A with """ assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(7,2--7,5): This union case does not take arguments" + "(7,2--7,5): Pattern discard is not allowed for union case that takes no data." "(6,6--6,7): Incomplete pattern matches on this expression. For example, the value 'B (_)' may indicate a case not covered by the pattern(s)." ] diff --git a/tests/service/ServiceUntypedParseTests.fs b/tests/service/ServiceUntypedParseTests.fs index ea2591b8bf9..147680ca511 100644 --- a/tests/service/ServiceUntypedParseTests.fs +++ b/tests/service/ServiceUntypedParseTests.fs @@ -839,7 +839,7 @@ add2 1 2 | Some range -> range |> tups - |> shouldEqual ((3, 17), (3, 18)) + |> shouldEqual ((3, 18), (3, 18)) [] let ``TryRangeOfFunctionOrMethodBeingApplied - inside CE``() = diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs index e724edbad09..058c45f8eed 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs @@ -6517,7 +6517,7 @@ let rec f l = let b = (new NS1.MyModule.TestType())(*MarkerMethod*) """, marker = "(*MarkerType*)" , - list = ["TestType"]) + list = []) [] member this.``Class.DefInDiffNameSpace.WithAttributes.Negative``() = diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index fdcb06bde04..b62f508c919 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -511,19 +511,6 @@ type staticInInterface = type foo = N1.T< const "Hello World",2>""", num = 1) - [] - [] - [] - //This test case Verify that the Warning list count is one in the Warning list item when there is incorrect indentation in the code. - member public this.``TypeProvider.StaticParameters.WarningListItem `` () = - - this.VerifyWarningListCountAtOpenProject( - fileContents = """ - type foo = N1.T< - const "Hello World",2>""", - expectedNum = 1, - addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) - [] [] [] @@ -627,7 +614,7 @@ type staticInInterface = let a = NoVal""", num = 1 ) - [] + // [] disabled for F#8, legacy service, covered in FCS tests instead member public this.``CompilerErrorsInErrList4``() = this.VerifyNoErrorListAtOpenProject( fileContents = """ @@ -644,13 +631,8 @@ type staticInInterface = let f x = function A -> true | B -> false - #nowarn "58" // FS0058: possible incorrect indentation: this token is offside of context started at - let _fsyacc_gotos = [| - 0us; - 1us; - 2us - |] """ ) + let _fsyacc_gotos = [| 0us; 1us; 2us|] """ ) [] member public this.``CompilerErrorsInErrList5``() = diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs index f9c8d050d49..84ba5968e82 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs @@ -285,7 +285,7 @@ type UsingMSBuild() = foo((*Mark*)""" this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Mark*)",[["'a"]]) - [] + // [] disabled for F#8, legacy service, covered in FCS tests instead member public this.``Single.DiscriminatedUnion.Construction``() = let fileContent = """ type MyDU = @@ -305,7 +305,7 @@ type UsingMSBuild() = this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Mark3*)",[["``Long Name`` : int"; "string"]]) this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Mark4*)",[["int"]]) - [] + // [] disabled for F#8, legacy service, covered in FCS tests instead member public this.``Single.Exception.Construction``() = let fileContent = """ exception E1 of int * string From d7420dc130fc58cb5a8585bdb1b40d6b6eaf488a Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 17 Aug 2023 12:03:06 +0200 Subject: [PATCH 12/18] Final (?) tests fixes #5, please --- tests/fsharp/typecheck/sigs/neg74.vsbsl | 112 +----------------- tests/fsharp/typecheck/sigs/neg75.vsbsl | 18 +-- tests/fsharp/typecheck/sigs/neg76.vsbsl | 18 +-- tests/fsharp/typecheck/sigs/neg77.vsbsl | 12 +- tests/fsharp/typecheck/sigs/neg81.vsbsl | 24 ---- .../Tests.LanguageService.Completion.fs | 2 +- 6 files changed, 5 insertions(+), 181 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg74.vsbsl b/tests/fsharp/typecheck/sigs/neg74.vsbsl index 609fcc1264e..75fe17547b8 100644 --- a/tests/fsharp/typecheck/sigs/neg74.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg74.vsbsl @@ -1,114 +1,4 @@ neg74.fsx(185,1,185,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. -neg74.fsx(185,1,185,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(194,1,194,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(194,1,194,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(203,1,203,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(203,1,203,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(212,1,212,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(212,1,212,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(221,1,221,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(221,1,221,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(230,1,230,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(230,1,230,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(231,1,231,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(231,1,231,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(232,1,232,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(232,1,232,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(233,1,233,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(233,1,233,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(234,1,234,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(234,1,234,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(236,1,236,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(236,1,236,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0010: Unexpected symbol '[<' in binding. Expected incomplete structured construct at or before this point or other token. - -neg74.fsx(242,1,242,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(242,1,242,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(254,1,254,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file - -neg74.fsx(185,1,185,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(185,1,185,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(194,1,194,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(194,1,194,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(203,1,203,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(203,1,203,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(212,1,212,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(212,1,212,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(221,1,221,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(221,1,221,4): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(230,1,230,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(230,1,230,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(231,1,231,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(231,1,231,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(232,1,232,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(232,1,232,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(233,1,233,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(233,1,233,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(234,1,234,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(234,1,234,13): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(236,1,236,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(236,1,236,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(241,1,241,3): parse error FS0010: Unexpected symbol '[<' in binding. Expected incomplete structured construct at or before this point or other token. - -neg74.fsx(242,1,242,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(242,1,242,3): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (183:28). Try indenting this token further or using standard formatting conventions. - -neg74.fsx(254,1,254,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file - -neg74.fsx(183,52,183,53): typecheck error FS0043: The type 'unit' does not match the type 'float' +neg74.fsx(183,52,183,53): parse error FS3156: Unexpected token '+' or incomplete expression diff --git a/tests/fsharp/typecheck/sigs/neg75.vsbsl b/tests/fsharp/typecheck/sigs/neg75.vsbsl index fbafdc0a328..2ce481d92dd 100644 --- a/tests/fsharp/typecheck/sigs/neg75.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg75.vsbsl @@ -1,20 +1,4 @@ neg75.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. -neg75.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(153,24,153,27): parse error FS0588: The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. - -neg75.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg75.fsx(153,24,153,27): parse error FS0588: The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. +neg75.fsx(153,79,153,80): parse error FS3156: Unexpected token '+' or incomplete expression diff --git a/tests/fsharp/typecheck/sigs/neg76.vsbsl b/tests/fsharp/typecheck/sigs/neg76.vsbsl index b7e157d83f6..00657dfc934 100644 --- a/tests/fsharp/typecheck/sigs/neg76.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg76.vsbsl @@ -1,20 +1,4 @@ neg76.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. -neg76.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(153,24,153,27): parse error FS0588: The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. - -neg76.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(154,24,154,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(155,24,155,27): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (153:38). Try indenting this token further or using standard formatting conventions. - -neg76.fsx(153,24,153,27): parse error FS0588: The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. +neg76.fsx(153,79,153,80): parse error FS3156: Unexpected token '*' or incomplete expression diff --git a/tests/fsharp/typecheck/sigs/neg77.vsbsl b/tests/fsharp/typecheck/sigs/neg77.vsbsl index 44832298057..fabc3b04188 100644 --- a/tests/fsharp/typecheck/sigs/neg77.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg77.vsbsl @@ -1,14 +1,4 @@ neg77.fsx(134,15,134,16): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (133:19). Try indenting this token further or using standard formatting conventions. -neg77.fsx(134,15,134,16): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (133:19). Try indenting this token further or using standard formatting conventions. - -neg77.fsx(134,15,134,16): parse error FS0010: Unexpected symbol '|' in expression - -neg77.fsx(134,15,134,16): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (133:19). Try indenting this token further or using standard formatting conventions. - -neg77.fsx(134,15,134,16): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (133:19). Try indenting this token further or using standard formatting conventions. - -neg77.fsx(134,15,134,16): parse error FS0010: Unexpected symbol '|' in expression - -neg77.fsx(153,75,153,79): typecheck error FS0001: The type 'Planet * 'a' is not compatible with the type 'Planet' +neg77.fsx(134,15,134,16): parse error FS0010: Incomplete structured construct at or before this point in expression diff --git a/tests/fsharp/typecheck/sigs/neg81.vsbsl b/tests/fsharp/typecheck/sigs/neg81.vsbsl index e7f03277d2b..7913d5b7ea4 100644 --- a/tests/fsharp/typecheck/sigs/neg81.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg81.vsbsl @@ -1,28 +1,4 @@ neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:5). Try indenting this token further or using standard formatting conventions. -neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:5). Try indenting this token further or using standard formatting conventions. - -neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (5:1). Try indenting this token further or using standard formatting conventions. - -neg81.fsx(6,6,6,7): parse error FS3156: Unexpected token '+' or incomplete expression - -neg81.fsx(8,1,8,5): parse error FS0010: Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. - -neg81.fsx(5,1,5,4): parse error FS3118: Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. - -neg81.fsx(10,1,10,1): parse error FS0010: Incomplete structured construct at or before this point in definition. Expected incomplete structured construct at or before this point or other token. - -neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:5). Try indenting this token further or using standard formatting conventions. - -neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:5). Try indenting this token further or using standard formatting conventions. - -neg81.fsx(8,1,8,5): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (5:1). Try indenting this token further or using standard formatting conventions. - neg81.fsx(6,6,6,7): parse error FS3156: Unexpected token '+' or incomplete expression - -neg81.fsx(8,1,8,5): parse error FS0010: Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. - -neg81.fsx(5,1,5,4): parse error FS3118: Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. - -neg81.fsx(10,1,10,1): parse error FS0010: Incomplete structured construct at or before this point in definition. Expected incomplete structured construct at or before this point or other token. diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs index 058c45f8eed..819d68db047 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs @@ -6581,7 +6581,7 @@ let rec f l = let b = (new NS1.MyModule.TestType())(*MarkerMethod*) """, marker = "(*MarkerMethod*)", - list = ["TestMethod";"VisibleMethod";"VisibleMethod2"]) + list = ["VisibleMethod";"VisibleMethod2"]) [] member this.``Method.DefInDiffNameSpace.WithAttributes.Negative``() = From 417e37e68e5075163d2e03ba2031fea563524fb8 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 17 Aug 2023 12:51:38 +0200 Subject: [PATCH 13/18] Final (?) tests fixes #6, pretty please --- .../Tests.LanguageService.Completion.fs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs index 819d68db047..a88ce83e903 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs @@ -6492,7 +6492,7 @@ let rec f l = this.VerifyDotCompListContainAllAtStartOfMarker( fileContents = """ namespace NS1 - module MyModule = + module MyModule = [] type ObsoleteType() = member this.TestMethod() = 10 @@ -6517,14 +6517,14 @@ let rec f l = let b = (new NS1.MyModule.TestType())(*MarkerMethod*) """, marker = "(*MarkerType*)" , - list = []) + list = ["TestType"]) [] member this.``Class.DefInDiffNameSpace.WithAttributes.Negative``() = this.VerifyDotCompListDoesNotContainAnyAtStartOfMarker( fileContents = """ namespace NS1 - module MyModule = + module MyModule = [] type ObsoleteType() = member this.TestMethod() = 10 @@ -6556,7 +6556,7 @@ let rec f l = this.VerifyDotCompListContainAllAtStartOfMarker( fileContents = """ namespace NS1 - module MyModule = + module MyModule = [] type ObsoleteType() = member this.TestMethod() = 10 @@ -6575,13 +6575,14 @@ let rec f l = member this.VisibleMethod() = 10 [] member this.VisibleMethod2() = 10 + namespace NS2 module m2 = - type x = NS1.MyModule(*MarkerType*) - let b = (new NS1.MyModule.TestType())(*MarkerMethod*) + type x = NS1.MyModule(*MarkerType*) + let b = (new NS1.MyModule.TestType())(*MarkerMethod*) """, marker = "(*MarkerMethod*)", - list = ["VisibleMethod";"VisibleMethod2"]) + list = ["TestMethod"; "VisibleMethod";"VisibleMethod2"]) [] member this.``Method.DefInDiffNameSpace.WithAttributes.Negative``() = From 5118993c91c317d2939e324cb4a709e22e963723 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 17 Aug 2023 14:36:59 +0200 Subject: [PATCH 14/18] Final (?) tests fixes #7, pretty please with cherry on top --- tests/fsharp/typecheck/sigs/neg77.vsbsl | 2 ++ .../CompilerOptions/fsc/standalone/env.lst | 2 +- .../langversion/langversionhelp.437.1033.bsl | 3 +- .../ComputationExpressions/Capacity01.fs | 34 +++++++++++++++---- .../QueryExpressions/E_BadGroupValBy02.fs | 14 ++++---- .../Comments/E_ocamlstyle_nested006.fs | 3 +- .../HashLight/W_OffsideAccessibility01.fs | 6 ++-- .../Diagnostics/NONTERM/tuplewithlazy01.fs | 3 +- .../Diagnostics/NONTERM/tuplewithlazy01b.fs | 3 +- .../Diagnostics/ParsingAtEOF/du_with01.fs | 3 +- .../ParsingAtEOF/type_id_equal01.fsx | 5 ++- .../ParsingAtEOF/type_id_equal02.fsi | 8 ++--- .../ParsingAtEOF/type_id_parens01.fs | 5 ++- .../Misc/VerbatimIdentifier01.fsx | 2 -- .../Source/Libraries/Portable/env.lst | 2 +- 15 files changed, 54 insertions(+), 41 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg77.vsbsl b/tests/fsharp/typecheck/sigs/neg77.vsbsl index fabc3b04188..104804c50a9 100644 --- a/tests/fsharp/typecheck/sigs/neg77.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg77.vsbsl @@ -2,3 +2,5 @@ neg77.fsx(134,15,134,16): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (133:19). Try indenting this token further or using standard formatting conventions. neg77.fsx(134,15,134,16): parse error FS0010: Incomplete structured construct at or before this point in expression + +neg77.fsx(153,75,153,79): typecheck error FS0001: The type 'Planet * 'a' is not compatible with the type 'Planet' diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/standalone/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/standalone/env.lst index a051f59cdd7..b532dc7f079 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/standalone/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/standalone/env.lst @@ -1,2 +1,2 @@ SOURCE=E_MayNotIncludeEXE.fs SCFLAGS="--standalone --target:library -r:E_MayNotIncludeEXERef.exe" PRECMD="\$FSC_PIPE --target:exe E_MayNotIncludeEXERef.fs" # E_MayNotIncludeEXE.fs -NOMONO SOURCE=W_MissingTransitiveRef.fs SCFLAGS="--standalone --target:library -r:PresentationFramework.dll" COMPILE_ONLY=1 # W_MissingTransitiveRef.fs +NOMONO SOURCE=W_MissingTransitiveRef.fs SCFLAGS="--standalone --target:library -r:PresentationFramework.dll" COMPILE_ONLY=1 PEVER="/Exp_Fail" # W_MissingTransitiveRef.fs 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 2e3e65520ac..9d7ff2f395c 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl @@ -7,4 +7,5 @@ latestmajor 4.7 5.0 6.0 -7.0 (Default) \ No newline at end of file +7.0 +8.0 (Default) \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/Capacity01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/Capacity01.fs index ca869db97ac..85b3084c1ee 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/Capacity01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/Capacity01.fs @@ -5,15 +5,35 @@ // Nesting for loops instead... let test1 = seq { - for a in 0 .. 0 do for b in 0 .. 0 do for c in 0 .. 0 do for d in 0 .. 0 do for e in 0 .. 0 do - for f in 0 .. 0 do for g in 0 .. 0 do for h in 0 .. 0 do for i in 0 .. 0 do for j in 0 .. 0 do - for k in 0 .. 0 do for l in 0 .. 0 do for m in 0 .. 0 do for n in 0 .. 0 do for o in 0 .. 0 do - for p in 0 .. 0 do for q in 0 .. 0 do for r in 0 .. 0 do for s in 0 .. 0 do for t in 0 .. 0 do - for u in 0 .. 0 do for v in 0 .. 0 do for w in 0 .. 0 do for x in 0 .. 0 do for y in 0 .. 0 do - for z in 0 .. 0 do + for a in 0 .. 0 do + for b in 0 .. 0 do + for c in 0 .. 0 do + for d in 0 .. 0 do + for e in 0 .. 0 do + for f in 0 .. 0 do + for g in 0 .. 0 do + for h in 0 .. 0 do + for i in 0 .. 0 do + for j in 0 .. 0 do + for k in 0 .. 0 do + for l in 0 .. 0 do + for m in 0 .. 0 do + for n in 0 .. 0 do + for o in 0 .. 0 do + for p in 0 .. 0 do + for q in 0 .. 0 do + for r in 0 .. 0 do + for s in 0 .. 0 do + for t in 0 .. 0 do + for u in 0 .. 0 do + for v in 0 .. 0 do + for w in 0 .. 0 do + for x in 0 .. 0 do + for y in 0 .. 0 do + for z in 0 .. 0 do yield (a, b, c, d, e, f, g, j, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) } - + // Main test is to see if this compiles if Seq.length test1 <> 1 then exit 1 diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs index bc604c6f5ac..8f4388044c9 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs @@ -1,11 +1,11 @@ // #Conformance #DataExpressions #Query // DevDiv:210830, groupValBy with poor diagnostics -//This expression was expected to have type.+'System\.Linq\.IGrouping<'a,'b>'.+but here has type.+'unit' - +//'groupValBy' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected 2 argument(s), but given 3. +//This expression was expected to have type.+'System\.Linq\.IGrouping<'a,'b>'.+but here has type.+'unit' let words = ["blueberry"; "chimpanzee"; ] let wordGroups = -query { - for w in words do - groupValBy w w.[0]. into g - select (g.Key, g.ToArray()) -} + query { + for w in words do + groupValBy w w.[0]. into g + select (g.Key, g.ToArray()) + } diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs index aee52e7b8ec..7f266a65a19 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs @@ -1,8 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1561 // The OCaml (** *) feature is now gone, so this test will be a negative test from now on. -//Possible incorrect indentation: this token is offside of context started at position \(10:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(10:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//Possible incorrect indentation: this token is offside of context started at position \(10:1\)\. Try indenting this token further or using standard formatting conventions\.$ //Incomplete structured construct at or before this point in binding$ //End of file in comment begun at or before here$ diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs index 08a55ac34ff..ade12160e53 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs @@ -1,9 +1,9 @@ // #Regression #Conformance #LexFilter // FSB 2150, Offside rule for #light code should set offside to left of accessibility modifier if present -//Possible incorrect indentation: this token is offside of context started at position \(17:5\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(17:5\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(17:5\)\. Try indenting this token further or using standard formatting conventions\.$ +//Possible incorrect indentation: this token is offside of context started at position \(17:5\)\. Try indenting this token further or using standard formatting conventions\.$ +//Expecting expression\.$ +//Unexpected symbol '{' in member definition$ open System open System.IO diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs index 3017761a5e2..27b2a091a49 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs @@ -2,11 +2,10 @@ // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it //Unexpected keyword 'lazy' in type definition$ -//Unexpected keyword 'lazy'$ +//Unexpected keyword 'lazy'.* // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end // 6 elements -> weird diagnostics (in non RET builds) type Bad(a, b, c, d, e, f : lazy) = class end - diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index 6e950dfac58..8a11948fe54 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -1,12 +1,11 @@ // #Regression #Diagnostics // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it -//NONTERM //Unexpected keyword 'lazy' in type definition$ +//Unexpected keyword 'lazy'.* // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end // 6 elements -> weird diagnostics (in non RET builds) type Bad(a, b, c, d, e, f : lazy) = class end - diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs index 1bdf00755f4..a296a9b46a1 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs @@ -1,6 +1,5 @@ // #Regression #Diagnostics -//Possible incorrect indentation: this token is offside of context started at position \(6:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(6:1\)\. Try indenting this token further or using standard formatting conventions\.$ +// Possible incorrect indentation: this token is offside of context started at position \(6:1\)\. Try indenting this token further or using standard formatting conventions\.$ // Note: this is now a positive test (see DevDiv:258510) type C = diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx index f884fee6433..912dd2b40a9 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx @@ -1,5 +1,4 @@ // #Regression #Diagnostics -//Possible incorrect indentation: this token is offside of context started at position \(5:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(5:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ +//Possible incorrect indentation: this token is offside of context started at position \(5:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ type C() = diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi index 3e6b127d6c9..30ba825548b 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi @@ -1,9 +1,7 @@ // #Regression #Diagnostics -//Possible incorrect indentation: this token is offside of context started at position \(9:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(9:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ -//Possible incorrect indentation: this token is offside of context started at position \(3:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(3:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//Possible incorrect indentation: this token is offside of context started at position \(9:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ +//Possible incorrect indentation: this token is offside of context started at position \(3:1\)\. Try indenting this token further or using standard formatting conventions\.$ //A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ module M type C = diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs index c7334cd54b5..c40db1afc6f 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs @@ -1,7 +1,6 @@ // #Regression #Diagnostics -//Possible incorrect indentation: this token is offside of context started at position \(7:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//Possible incorrect indentation: this token is offside of context started at position \(7:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ +//Possible incorrect indentation: this token is offside of context started at position \(7:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ type C() = diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/VerbatimIdentifier01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/VerbatimIdentifier01.fsx index e0d3100b557..211e025f8f0 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/VerbatimIdentifier01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/VerbatimIdentifier01.fsx @@ -36,7 +36,5 @@ let ``A0`` = true;; let ``A-B`` = true;; let ``A B`` = true;; let ``base`` = true;; -let ``or`` = true;; exit 0;; - diff --git a/tests/fsharpqa/Source/Libraries/Portable/env.lst b/tests/fsharpqa/Source/Libraries/Portable/env.lst index a0572e339b8..fd5dc3de810 100644 --- a/tests/fsharpqa/Source/Libraries/Portable/env.lst +++ b/tests/fsharpqa/Source/Libraries/Portable/env.lst @@ -1,4 +1,4 @@ # C# can consume an F# assembly that exposes a type with a method that returns a System.Numeric.BigInteger NoMT SOURCE=provider.fs POSTCMD="\$CSC_PIPE /r:provider.dll /r:System.Numerics.dll consumer.cs && consumer.exe" SCFLAGS=-a # consumer.fs (Desktop) -NoMT SOURCE=parse_tests.fs SCFLAGS="--standalone -g -a" POSTCMD="\$CSC_PIPE /debug+ /r:parse_tests.dll /r:System.Numerics.dll parse_oracle.cs && parse_oracle.exe" # parse_tests.fs (Desktop) +NoMT SOURCE=parse_tests.fs SCFLAGS="--standalone -g -a" PEVER="/Exp_Fail" POSTCMD="\$CSC_PIPE /debug+ /r:parse_tests.dll /r:System.Numerics.dll parse_oracle.cs && parse_oracle.exe" # parse_tests.fs (Desktop) From 1a6d16256eeaf9e8f9986b0efb5477ff16ea3644 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 17 Aug 2023 17:15:58 +0200 Subject: [PATCH 15/18] Final (?) tests fixes #8, pretty please with cherry on top, please have mercy --- .../DataExpressions/QueryExpressions/E_BadGroupValBy02.fs | 4 ++-- .../LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs | 6 +++--- .../LexicalFiltering/HashLight/W_OffsideAccessibility01.fs | 2 +- .../fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs | 2 +- .../fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs | 2 +- tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs | 2 +- .../Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx | 2 +- .../Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi | 2 +- .../Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs index 8f4388044c9..2000105ad3c 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/QueryExpressions/E_BadGroupValBy02.fs @@ -1,7 +1,7 @@ // #Conformance #DataExpressions #Query // DevDiv:210830, groupValBy with poor diagnostics -//'groupValBy' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected 2 argument(s), but given 3. -//This expression was expected to have type.+'System\.Linq\.IGrouping<'a,'b>'.+but here has type.+'unit' +//.+ +//This expression was expected to have type.+'System\.Linq\.IGrouping<'a,'b>'.+but here has type.+'unit' let words = ["blueberry"; "chimpanzee"; ] let wordGroups = query { diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs index 7f266a65a19..106ddc7c41d 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_ocamlstyle_nested006.fs @@ -1,9 +1,9 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1561 // The OCaml (** *) feature is now gone, so this test will be a negative test from now on. -//Possible incorrect indentation: this token is offside of context started at position \(10:1\)\. Try indenting this token further or using standard formatting conventions\.$ -//Incomplete structured construct at or before this point in binding$ -//End of file in comment begun at or before here$ +//Possible incorrect indentation: this token is offside of context started at position \(9:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//Incomplete structured construct at or before this point in binding$ +//End of file in comment begun at or before here$ let y6 = (** This is a comment with (***) 6 (**) diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs index ade12160e53..a2283e30777 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/W_OffsideAccessibility01.fs @@ -2,7 +2,7 @@ // FSB 2150, Offside rule for #light code should set offside to left of accessibility modifier if present //Possible incorrect indentation: this token is offside of context started at position \(17:5\)\. Try indenting this token further or using standard formatting conventions\.$ -//Expecting expression\.$ +//Expecting expression$ //Unexpected symbol '{' in member definition$ open System diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs index 27b2a091a49..d6b643b5956 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs @@ -2,7 +2,7 @@ // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it //Unexpected keyword 'lazy' in type definition$ -//Unexpected keyword 'lazy'.* +//Unexpected keyword 'lazy'.+ // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index 8a11948fe54..449e6052344 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -2,7 +2,7 @@ // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it //Unexpected keyword 'lazy' in type definition$ -//Unexpected keyword 'lazy'.* +//.+ // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs index a296a9b46a1..47c353c2f16 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/du_with01.fs @@ -1,5 +1,5 @@ // #Regression #Diagnostics -// Possible incorrect indentation: this token is offside of context started at position \(6:1\)\. Try indenting this token further or using standard formatting conventions\.$ +// Possible incorrect indentation: this token is offside of context started at position \(5:1\)\. Try indenting this token further or using standard formatting conventions\.$ // Note: this is now a positive test (see DevDiv:258510) type C = diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx index 912dd2b40a9..e6dbdcefaa8 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal01.fsx @@ -1,4 +1,4 @@ // #Regression #Diagnostics -//Possible incorrect indentation: this token is offside of context started at position \(5:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//Possible incorrect indentation: this token is offside of context started at position \(4:1\)\. Try indenting this token further or using standard formatting conventions\.$ //A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ type C() = diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi index 30ba825548b..257e4589946 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_equal02.fsi @@ -1,5 +1,5 @@ // #Regression #Diagnostics -//Possible incorrect indentation: this token is offside of context started at position \(9:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//Possible incorrect indentation: this token is offside of context started at position \(7:1\)\. Try indenting this token further or using standard formatting conventions\.$ //A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ //Possible incorrect indentation: this token is offside of context started at position \(3:1\)\. Try indenting this token further or using standard formatting conventions\.$ //A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ diff --git a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs index c40db1afc6f..91562efcc52 100644 --- a/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs +++ b/tests/fsharpqa/Source/Diagnostics/ParsingAtEOF/type_id_parens01.fs @@ -1,5 +1,5 @@ // #Regression #Diagnostics -//Possible incorrect indentation: this token is offside of context started at position \(7:1\)\. Try indenting this token further or using standard formatting conventions\.$ +//Possible incorrect indentation: this token is offside of context started at position \(6:1\)\. Try indenting this token further or using standard formatting conventions\.$ //A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end'\.$ From acc44114daa21ddf49e5b980e3aca9a7751ce4a0 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 17 Aug 2023 17:33:20 +0200 Subject: [PATCH 16/18] Final (?) tests fixes #9, pretty please with cherry on top, please have mercy --- tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index 449e6052344..32e5d5aa3bc 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -1,8 +1,8 @@ // #Regression #Diagnostics // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it -//Unexpected keyword 'lazy' in type definition$ -//.+ +// Unexpected keyword 'lazy' in type definition$ +// NONTERM // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end From 8cb141a133f24d5fa628b84f5065d25942b0e9c4 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 17 Aug 2023 18:42:12 +0200 Subject: [PATCH 17/18] Final (?) tests fixes #10, pretty please with cherry on top, please have mercy --- tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst | 2 +- tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst b/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst index 676d5fb9969..e9b7aee42ca 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst @@ -1,5 +1,5 @@ SOURCE=tuplewithlazy01.fs SCFLAGS="--test:ErrorRanges" # tuplewithlazy01.fs - SOURCE=tuplewithlazy01b.fs SCFLAGS="--test:ErrorRanges" # tuplewithlazy01b.fs + SOURCE=tuplewithlazy01b.fs SCFLAGS="--test:ErrorRanges" # tuplewithlazy01b.fs SOURCE=attrUnionCaseDecl01.fs SCFLAGS="--test:ErrorRanges" # attrUnionCaseDecl01.fs SOURCE=attrUnionCaseDecl01b.fs SCFLAGS="--test:ErrorRanges" # attrUnionCaseDecl01b.fs diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index 32e5d5aa3bc..d6b643b5956 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -1,8 +1,8 @@ // #Regression #Diagnostics // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it -// Unexpected keyword 'lazy' in type definition$ -// NONTERM +//Unexpected keyword 'lazy' in type definition$ +//Unexpected keyword 'lazy'.+ // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end From e2a77279b205ae7f7fa0e6759138713b2be16252 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 18 Aug 2023 11:11:23 +0200 Subject: [PATCH 18/18] Final (?) tests fixes #11, pretty please with cherry on top, please have mercy, I'm begging you --- tests/fsharp/typecheck/sigs/pos13.fs | 9 ++++----- .../Source/Diagnostics/NONTERM/tuplewithlazy01.fs | 2 +- .../Source/Diagnostics/NONTERM/tuplewithlazy01b.fs | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/pos13.fs b/tests/fsharp/typecheck/sigs/pos13.fs index c7421dc4e7c..b48c914709d 100644 --- a/tests/fsharp/typecheck/sigs/pos13.fs +++ b/tests/fsharp/typecheck/sigs/pos13.fs @@ -1,9 +1,8 @@ type Enum1 = | E = 1 - -module Ext = - type Enum1 - with - member this.Foo() = 42 // ok - extrinsic extension + +module Ext = + type Enum1 with + member this.Foo() = 42 // ok - extrinsic extension open Ext let r = Enum1.E.Foo() diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs index d6b643b5956..8e2724f49ce 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01.fs @@ -2,7 +2,7 @@ // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it //Unexpected keyword 'lazy' in type definition$ -//Unexpected keyword 'lazy'.+ +//Unexpected keyword 'lazy'$ // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index d6b643b5956..8e2724f49ce 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -2,7 +2,7 @@ // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it //Unexpected keyword 'lazy' in type definition$ -//Unexpected keyword 'lazy'.+ +//Unexpected keyword 'lazy'$ // 5 elements -> ok type Ok(a, b, c, d, e : lazy) = class end