Skip to content

Commit 162c811

Browse files
authored
Stop using langversion <= 7 in tests (#19223)
* Migrate StaticClassTests.fs from withLangVersion70 to withLangVersion80 Updated all 25 test configurations to use withLangVersion80 instead of withLangVersion70. This is part of the test suite migration to require minimum language version 8.0. * Migrate ErrorMessages tests from withLangVersionXX to withLangVersionPreview Migrated all ErrorMessages test files to use withLangVersionPreview instead of withLangVersion70/60/50/47/46. Updated test expectations where behavior differs between old language versions and preview. Files changed: - WarnExpressionTests.fs - ClassesTests.fs - IndexingSyntax.fs - ModuleTests.fs - ConstructorTests.fs - UnionCasePatternMatchingErrors.fs - NameResolutionTests.fs - WarnIfDiscardedInList.fs * Migrate Language test files: replace withLangVersionXX with withLangVersionPreview - Delete negative version gate tests that check 'Feature not available in F# 7.0' errors - Migrate positive tests from withLangVersion50/70 to withLangVersionPreview - Files: CodeQuotationTests, InterfaceTests, NameofTests, CopyAndUpdateTests, DotLambdaTests, PrintfFormatTests, AttributeCheckingTests, ExtensionMethodTests * Migrate ComponentTests/Interop tests to langVersion80 - RequiredAndInitOnlyProperties.fs: 15 withLangVersion70 -> withLangVersion80 - StaticsInInterfaces.fs: 8 withLangVersion70 -> withLangVersion80 - VisibilityTests.fs: 4 withLangVersion70 + 4 withLangVersion50 -> withLangVersion80 * Migrate Conformance tests to withLangVersion80 - Remove old langversion tests (46, 47, 50, 60, 70) from Conformance files - Delete version-specific tests that test obsolete behavior: - RelaxWhitespace2_Indentation (F# 6.0 specific) - RelaxWhitespace2_Fs50 (F# 5.0 specific, ~4700 lines) - Static type parameter inference in version 6 - LowercaseWhenRequireQualifiedAccess_fs in langversion 6 - Update remaining tests to use withLangVersion80 - Delete obsolete negative version tests in StaticLet, ErrorMessages, Language * Migrate ComponentTests Diagnostics and Miscellaneous to langversion 8.0 - Records.fs: withLangVersion70 -> withLangVersion80 - ListLiterals.fs: Remove langversion 6.0 test, update 7.0 -> 8.0 - MigratedTypeCheckTests.fs: LangVersion.V50/V60/V70 -> V80 - FsharpSuiteMigrated.fs: Remove obsolete V47/V50/V60/V70 from adjustVersion - MigratedCoreTests.fs: LangVersion.V50/V70 -> V80 - Add test-langversion-8.0.fsx/.bsl for array-no-dot-warnings * Migrate ComponentTests EmittedIL files to langversion80 Migrated 4 files: - SerializableAttribute.fs: withLangVersion60 -> withLangVersion80 (2 occurrences) - TestFunctions.fs: withLangVersion70 -> withLangVersion80 - Literals.fs: Converted version-gate test to check success with 8.0 - MethodImplAttribute.fs: Removed redundant F# 7 version-gate test * Migrate tests/fsharp small files to langversion 8.0 - SignatureGenerationTests.fs: withLangVersion50 → withLangVersion80 - NullableOptionalRegressionTests.fs: withLangVersion50 → withLangVersion80 - WitnessTests.fs: withLangVersion50 → withLangVersion80 - ForInDoMutableRegressionTest.fs: --langversion:5.0 → --langversion:8.0 - ComparisonTests.fs: --langversion:5.0 → --langversion:8.0 - StringFormatTests.fs: --langversion:5.0 → --langversion:8.0 * Migrate OpenTypeDeclarationTests.fs to langversion 8.0 - Replace all withLangVersion50 with withLangVersion80 - Delete 5 test cases that use withLangVersion46 (negative version gate tests) - Update raw --langversion:5.0 strings to --langversion:8.0 - Update targetVersion literal from "5.0" to "8.0" * Migrate DefaultInterfaceMemberTests.fs to langversion 8.0 - Remove DefaultInterfaceMemberConsumptionTests_LanguageVersion_4_6 module (langversion 4.6 negative version gate tests are obsolete) - Remove DefaultInterfaceMemberConsumptionTests_LanguageVersion_4_6_net472 module - Remove DefaultInterfaceMemberConsumptionTests_net472 module - Replace all --langversion:5.0 with --langversion:8.0 in remaining tests - Reduces file from 4953 to 3878 lines * Migrate remaining tests/fsharp/Compiler/Language files to langversion 8.0 - Delete FixedIndexSliceTests.fs (all tests were version gate tests for 4.7) - Delete version gate test from StructActivePatternTests.fs - Delete version gate test from InterfaceTests.fs - Delete version gate tests from StringInterpolation.fs - Update all --langversion:5.0 to --langversion:8.0 * Migrate fsharpqa env.lst files to langversion 8.0 Updated 12 env.lst files to replace --langversion:4.X/5.X/6.X/7.X with --langversion:8.0. Deleted obsolete tests that specifically tested old version failures: - Deleted version46/ tests in SequenceExpressions - Deleted E_MultipleInst*.4.7.fs files in InterfaceTypes - Deleted E_*4.7.fs files for interface consumption tests - Deleted E_ObjExprWithSameInterface01.4.7.fs The CompilerOptions/fsi/langversion/env.lst is preserved as it tests INVALID version handling. * Migrate tests/fsharp/tests.fs to langversion 8.0+ - Delete subtype-langversion-46 test (used langversion 4.6) - Delete printing-langversion47 test (used langversion 4.7) - Delete libtest-langversion-46 test (used langversion 4.6) - Update sigs pos40 test from langversion 6.0 to 8.0 - C# langversion:7.2 flags unchanged (C# version, not F#) * Remove obsolete F# 4.6/4.7 langversion tests from tests.fs - Delete langversion 4.7 test block and baseline file from fsfromfsviacs test - Remove member-selfidentifier-version4_6/4_7 tests and directories - Remove indent-version4_7 test and related directories - Remove nameof-version4_6 test and directory - Remove type check neg24 version 4_6/4_7 tests and directories These tests are obsolete since F# 8.0 is now the minimum supported version. * Migrate FSharp.Compiler.Service.Tests to langversion 8.0 - Rename parseAndCheckScript50/70 to parseAndCheckScript80 in Common.fs - Rename getParseAndCheckResults50/70 to getParseAndCheckResults80 in Common.fs - Update all callers in ExprTests.fs and PatternMatchCompilationTests.fs - Replace --langversion:7.0 with --langversion:8.0 in ExprTests.fs * Fix PatternMatchCompilationTests expected diagnostics after langversion 8.0 migration - As 12/18: Remove duplicate diagnostic lines - As 20: Update expected diagnostic to match F# 8.0 behavior where the 'non-variable patterns to the right of as patterns' feature is now available * Migrate Scripting tests: LangVersion.V47 -> V80 * Migrate Conformance tests langversion strings from pre-8.0 to 8.0 - BasicConstants.fs: Update 4 occurrences of --langversion:5.0 to 8.0 - ComputationExpressions.fs: Update 1 occurrence of /langversion:4.7 to 8.0 * Remove obsolete langversion helpers (46/47/50/60/70) from test infrastructure - Remove withLangVersion46/47/50/60/70 helper functions from Compiler.fs - Remove LangVersion.V47/V50/V60/V70 enum values from ScriptHelpers.fs - Update langversion tests to use 8.0 instead of 5.0 - Remove v7.0 PropertyShadowing tests (feature always available in 8.0+) - Remove UseBindings Bad LangVersion test (5.0 no longer supported) - Update InvalidNumericLiteralTests FSI script to use langversion 8.0 All remaining langversion:(4.|5.|6.|7.) matches are either: - C# langversion (csc commands) - Invalid-version test files - Comments or baseline files * bunch of tests moved * Update OptionalInteropTests langversion from 5.0 to 8.0 * Add DELETION_EXPLANATION.md for core test files audit Analyzes the 6 deleted files in tests/fsharp/core/ as part of the LangVersion 8.0+ migration: - indent/version46/test.fsx (Category B - superseded) - indent/version47/test.fsx (Category B - superseded) - members/self-identifier/version46/test.fs (Category A - error test) - members/self-identifier/version47/test.fs (Category B - superseded) - nameof/version46/test.fsx (Category A - error test) - fsfromfsviacs/compilation.langversion.old.output.bsl (Category A) All deletions are justified - no Category C or D issues found. * Audit deleted typecheck/sigs version tests (4 files) Add analysis for the 4 deleted files in tests/fsharp/typecheck/sigs/version46/ and version47/: - neg24.fs (version46): FS0035 deprecated warnings - now handled by main neg24.fs - neg24.bsl (version46): Baseline with deprecated errors no longer applicable - neg24.fs (version47): Implicit yield tests - content now in main neg24.fs - neg24.bsl (version47): Baseline now used by main neg24.bsl All 4 files are Category B (superseded by retained counterpart). The main neg24.fs contains the version47 content testing implicit yield behavior, which is now the baseline for 8.0+ langversion. * Audit FixedIndexSliceTests.fs deletion Document the complete deletion of tests/fsharp/Compiler/Language/FixedIndexSliceTests.fs: - Category A deletion: Tests only verified 3D/4D slicing was NOT available in langversion 4.7 - Feature (Fixed-index slice) was introduced in F# 5.0 preview - Verified comprehensive coverage exists elsewhere: - Slices05.fs (conformance tests with 150+ lines of slicing tests) - Array3Module.fs (slicing unit tests) - Array4Module.fs (slicing unit tests) - core/array/test.fsx (runtime slicing tests) No coverage gap - the feature has extensive positive test coverage. * Audit fsharpqa InterfaceTypes 4.7 deletions Analyzed 7 deleted InterfaceTypes files that tested 'interfaces with multiple generic instantiation' errors: - E_MultipleInst01.4.7.fs - E_MultipleInst04.4.7.fs - E_MultipleInst07.4.7.fs - E_ImplementGenIFaceTwice01_4.7.fs - E_ImplementGenIFaceTwice02_4.7.fs - E_ConsumeMultipleInterfaceFromCS.4.7.fs - E_ClassConsumeMultipleInterfaceFromCS.4.7.fs All 7 are Category A (safe deletions) - they only tested FS3350 'feature not available in F# 4.7' errors. All have retained 5.0+ counterparts that test successful feature usage or semantic errors. * Audit fsharpqa ObjectExpressions and SequenceExpressions deletions Document the deletion justification for 4 fsharpqa conformance files: - ObjectExpressions/E_ObjExprWithSameInterface01.4.7.fs (Category A) - SequenceExpressions/version46/W_IfThenElse01.fs (Category B) - SequenceExpressions/version46/W_IfThenElse02.fs (Category B) - SequenceExpressions/version46/W_IfThenElse03.fs (Category B) All deletions are safe: - The 4.7 ObjectExpressions file only tested FS3350 'feature not available'; the 5.0 counterpart tests the real FS3361 'may unify' semantic error - The version46 SequenceExpressions files tested FS0035 'deprecated' warnings that were replaced by implicit yield in F# 4.7; version47 counterparts retained * Audit DefaultInterfaceMemberConsumptionTests_LanguageVersion_4_6 module deletion - Document that ~1070 lines deleted from DefaultInterfaceMemberTests.fs - Verify FS3350 version gate tests are Category A (safe to delete) - Confirm DIM consumption is positively tested at 8.0+ (33 Runs + 46 Errors tests) - No coverage gap: feature has comprehensive test coverage at 8.0 * Audit OpenTypeDeclarationTests.fs deletions Document the 5 deleted langversion:4.6 tests in OpenTypeDeclarationTests.fs: - OpenSystemMathOnce, OpenSystemMathTwice, OpenMyMathOnce - DontOpenAutoMath, OpenAutoMath All deleted tests fall into Category A (FS3350 'feature not available') or Category B (superseded by retained 8.0 counterpart). The open type declaration feature is thoroughly tested at langversion 8.0 with 40+ test scenarios covering nested types, generics, measures, enums, and error cases. * Audit StringInterpolation and StructActivePattern deletions Document 3 deleted test cases: - '%B fails for langVersion 5.0' (StringInterpolation.fs) - 'Basic string interpolation (4.7)' (StringInterpolation.fs) - 'Struct active pattern (-langversion:5.0)' (StructActivePatternTests.fs) All are Category A (version gate error message tests) - safe to delete as they only tested FS3350 'feature not available' errors that are pointless once older langversions are unsupported. * Add StaticClassTests.fs deletion audit to DELETION_EXPLANATION.md Audited all deleted 'lang version70' tests from StaticClassTests.fs. Confirmed each deleted test has a retained counterpart at 8.0/preview: - 24+ tests consolidated from version70/preview pairs to single tests - All deletions are Category B (superseded by retained counterpart) - No test coverage gap exists - Test naming improved by removing version suffixes * Complete StaticClassTests audit - add 4 missing deleted test entries * Audit ComponentTests Language folder deletions Add audit section for 5 deleted tests from ComponentTests/Language: - CopyAndUpdateTests.fs: 'Cannot use nested copy-and-update in lang version70' - DotLambdaTests.fs: 'ToString with F# 7' - PrintfFormatTests.fs: 'Non-inline literals cannot be used as printf format in lang version70' - InterfaceTests.fs: 'Concrete static members are not allowed in interfaces in lang version70' - ExtensionMethodTests.fs: No deletions, only version migrations All tests were Category A (testing version gate errors only). * Audit tests.fs deletions - document ~10 deleted test cases Added comprehensive analysis of deleted tests.fs test cases: - subtype-langversion-46 (Category B - superseded) - fsfromfsviacs langversion compilation (Category A - version gate) - printing-langversion47 (Category B - identical behavior) - libtest-langversion-46 (Category B - superseded) - member-selfidentifier-version4_6/4_7 (Categories A/B) - indent-version4_7 (Category B - superseded) - nameof-version4_6 (Category A - version gate) - type check neg24 version 4_6/4_7 (Category B - superseded) All ~10 deletions are safe: - 4 Category A: testing unavailability in old versions - 6 Category B: superseded by retained tests - No coverage gaps identified * Add executive summary section to DELETION_EXPLANATION.md - Add summary at top with total deletion counts (22 files, 74 entries) - Document Category A (27) and Category B (47) distribution - Confirm zero Category C/D issues requiring investigation - Cross-reference all 22 deleted files against git diff * Update env.lst * further cleanups * Clean up .ralph artifacts, DELETION_EXPLANATION.md, and LANGVERSION_IN_TESTS_MIGRATION.md * Fix CI test failures for langversion 8.0 migration - FixIndexerAccessLegacyTests: Fix squiggly from 'list[2]' to '[2]' - OpenTypeDeclarationTests: Update error code from 1 to 193 - neg132.bsl: Remove obsolete FS3510 langversion error - neg02.vsbsl: Remove FS3350 langversion error, add duplicate parse errors - E_QuoteDynamic01: Remove test (quotations with member constraints work in v8) - E_ConsumeMultipleInterfaceFromCS.5.0: Remove test (feature now allowed in v8) - E_MemberConstraint02/04, E_UnmanagedConstraint01, E_EqualityConstraint01, E_ComparisonConstraint01: Update error code from FS0001 to FS0193 - DefaultConstructorConstraint02: Update error code from FS0001 to FS0071 - E_Abbreviation.fsx: Update error message text - E_RigidTypeAnnotation02_5_0.fsx: Remove no longer produced error * Remove temp analysis file * Remove duplicate LangVersion60 SerializableAttribute tests These tests were identical to ToplevelModule_fs and ToplevelNamespace_fs after the branch changed withLangVersion60 to withLangVersion80. The source files (ToplevelModule60.fs, ToplevelNamespace60.fs) were exact duplicates of the non-60 versions, making these tests redundant. * Remove orphan version-suffixed test files - test-langversion-5.0.fsx/bsl: Identical to 8.0 version, not run by any test - E_ConsumeMultipleInterfaceFromCS.5.0.fs: Commented out in env.lst, multiple interface instantiation now works in langversion 8.0+ * Fix remaining CI test failures - neg20 version 8_0: Remove duplicate test, delete version50 folder - FixIndexerAccessLegacyTests: Revert squiggly to 'list[2]' (not '[2]') - E_MemberConstraint04.fs: Use regex . for embedded newlines in --flaterrors * Fix FixIndexerAccessLegacyTests - squiggly must end before bracket The codefix expands forward from span to find '[' then appends '.'. If span includes '[', it expands past end of line and produces wrong output. Changed variable name to 'xs' (unique) and squiggly to 'xs' (ends before '['). * Update E_MemberConstraint04.fs * Fix FixIndexerAccessLegacyTests with unique squiggly Use '= myList' as squiggly - unique to line 2 and ends before '['. The codefix expands forward to find '[' then appends '.' to the span.
1 parent d795504 commit 162c811

File tree

145 files changed

+683
-41577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+683
-41577
lines changed

azure-pipelines-PR.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ stages:
267267
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
268268
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
269269
NativeToolsOnMachine: true
270-
SKIP_VERSION_SUPPORTED_CHECK: 1
271270
displayName: Build
272271

273272
- task: PublishTestResults@2
@@ -317,7 +316,6 @@ stages:
317316
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
318317
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
319318
NativeToolsOnMachine: true
320-
SKIP_VERSION_SUPPORTED_CHECK: 1
321319
displayName: Build
322320

323321
- task: PublishTestResults@2
@@ -472,7 +470,6 @@ stages:
472470
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
473471
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp
474472
NativeToolsOnMachine: true
475-
SKIP_VERSION_SUPPORTED_CHECK: 1
476473
displayName: Build and Test $(_testKind) $(transparentCompiler)
477474

478475
- task: PublishTestResults@2
@@ -548,7 +545,6 @@ stages:
548545
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
549546
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
550547
NativeToolsOnMachine: true
551-
SKIP_VERSION_SUPPORTED_CHECK: 1
552548
displayName: Build / Test
553549

554550
- task: PublishTestResults@2
@@ -623,8 +619,6 @@ stages:
623619
- checkout: self
624620
clean: true
625621
- script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr
626-
env:
627-
SKIP_VERSION_SUPPORTED_CHECK: 1
628622
displayName: Build / Test
629623
- task: PublishTestResults@2
630624
displayName: Publish Test Results
@@ -670,7 +664,6 @@ stages:
670664
- script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr
671665
env:
672666
COMPlus_DefaultStackSize: 1000000
673-
SKIP_VERSION_SUPPORTED_CHECK: 1
674667
displayName: Build / Test
675668
- task: PublishTestResults@2
676669
displayName: Publish Test Results
@@ -713,7 +706,6 @@ stages:
713706
- script: .\Build.cmd -c Release -pack
714707
env:
715708
NativeToolsOnMachine: true
716-
SKIP_VERSION_SUPPORTED_CHECK: 1
717709
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release
718710
displayName: End to end build tests
719711

azure-pipelines.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ extends:
149149
NativeToolsOnMachine: true
150150
FSHARP_CACHE_OVERRIDE: 256
151151
FSharp_CacheEvictionImmediate: true
152-
SKIP_VERSION_SUPPORTED_CHECK: 1
153152
- task: PublishTestResults@2
154153
displayName: Publish Test Results
155154
inputs:

tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/langversion.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,23 @@ printfn "Hello, World"
5353
|> ignore
5454

5555
[<Fact>]
56-
let ``fsc langversion supports simple version number - --langversion:5``() =
56+
let ``fsc langversion supports simple version number - --langversion:8``() =
5757
FSharp """
5858
printfn "Hello, World"
5959
"""
6060
|> asExe
61-
|> withOptions ["--langversion:5"]
61+
|> withOptions ["--langversion:8"]
6262
|> compile
6363
|> shouldSucceed
6464
|> ignore
6565

6666
[<Fact>]
67-
let ``fsc langversion supports full version number - --langversion:5_0``() =
67+
let ``fsc langversion supports full version number - --langversion:8_0``() =
6868
FSharp """
6969
printfn "Hello, World"
7070
"""
7171
|> asExe
72-
|> withOptions ["--langversion:5.0"]
72+
|> withOptions ["--langversion:8.0"]
7373
|> compile
7474
|> shouldSucceed
7575
|> ignore

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ type I =
598598
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"IndexedPropertiesSameType.fs"|])>]
599599
let ``IndexedPropertiesSameType_fs`` compilation =
600600
compilation
601-
|> withLangVersion70
601+
|> withLangVersion80
602602
|> verifyCompileAndRun
603603
|> shouldSucceed
604604

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,8 @@ module Conformance.BasicGrammarElements.StaticLet
33
open Xunit
44
open FSharp.Test
55
open FSharp.Test.Compiler
6-
open System.IO
7-
8-
let testCasesForFSharp7ErrorMessage =
9-
Directory.EnumerateFiles(__SOURCE_DIRECTORY__)
10-
|> Seq.toArray
11-
|> Array.map Path.GetFileName
12-
|> Array.except [__SOURCE_FILE__;"PlainEnum.fs";"StaticLetExtensionToBuiltinType.fs"] // ALl files in the folder except this one with the tests
13-
|> Array.map (fun f -> [|f :> obj|])
14-
15-
16-
[<Theory>]
17-
[<MemberData(nameof(testCasesForFSharp7ErrorMessage))>]
18-
let ``Should fail in F# 7 and lower`` (implFileName:string) =
19-
let fileContents = File.ReadAllText (Path.Combine(__SOURCE_DIRECTORY__,implFileName))
20-
21-
Fs fileContents
22-
|> withLangVersion70
23-
|> typecheck
24-
|> shouldFail
25-
|> withErrorCode 902
26-
|> withDiagnosticMessageMatches "For F#7 and lower, static 'let','do' and 'member val' definitions may only be used in types with a primary constructor.*"
276

287
[<Theory>]
29-
[<InlineData("7.0")>]
308
[<InlineData("8.0")>]
319
[<InlineData("preview")>]
3210
let ``Regression in Member val - not allowed without primary constructor`` (langVersion:string) =
@@ -40,7 +18,6 @@ type Bad3 =
4018

4119

4220
[<Theory>]
43-
[<InlineData("7.0")>]
4421
[<InlineData("8.0")>]
4522
[<InlineData("preview")>]
4623
let ``Regression - Type augmentation with abstract slot not allowed`` (langVersion:string) =
@@ -54,7 +31,6 @@ type System.Random with
5431
|> withDiagnostics [Error 912, Line 3, Col 8, Line 3, Col 31, "This declaration element is not permitted in an augmentation"]
5532

5633
[<Theory>]
57-
[<InlineData("7.0")>]
5834
[<InlineData("8.0")>]
5935
[<InlineData("preview")>]
6036
let ``Regression - record with abstract slot not allowed`` (langVersion:string) =
@@ -137,14 +113,6 @@ let ``Static member val in empty type`` compilation =
137113
|> typecheck
138114
|> shouldSucceed
139115

140-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"StaticMemberValInEmptyType.fs"|])>]
141-
let ``Static member val in empty type Fsharp 7`` compilation =
142-
compilation
143-
|> withLangVersion70
144-
|> typecheck
145-
|> shouldFail
146-
|> withDiagnostics [Error 902, Line 4, Col 5, Line 4, Col 41, "For F#7 and lower, static 'let','do' and 'member val' definitions may only be used in types with a primary constructor ('type X(args) = ...'). To enable them in all other types, use language version '8' or higher."]
147-
148116
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"SimpleUnion.fs"|])>]
149117
let ``Static let in simple union`` compilation =
150118
compilation

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,16 @@ module UseBindings =
1212
let ``UseBindings - UseBindingDiscard01_fs - Current LangVersion`` compilation =
1313
compilation
1414
|> asFsx
15-
|> withLangVersion60
15+
|> withLangVersion80
1616
|> compile
1717
|> shouldSucceed
1818
|> ignore
1919

20-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"UseBindingDiscard01.fs"|])>]
21-
let ``UseBindings - UseBindingDiscard01_fs - Bad LangVersion`` compilation =
22-
compilation
23-
|> asFsx
24-
|> withOptions ["--langversion:5.0"]
25-
|> compile
26-
|> shouldFail
27-
|> withErrorCode 3350
28-
|> withDiagnosticMessageMatches "Feature 'discard pattern in use binding' is not available.*"
29-
3020
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"UseBindingDiscard02.fs"|])>]
3121
let ``Dispose called for discarded value of use binding`` compilation =
3222
compilation
3323
|> asExe
34-
|> withLangVersion60
24+
|> withLangVersion80
3525
|> compileAndRun
3626
|> shouldSucceed
3727

tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module RecursiveSafetyAnalysis =
4040
(Error 1118, Line 8, Col 15, Line 8, Col 25, "Failed to inline the value 'test' marked 'inline', perhaps because a recursive value was marked 'inline'")
4141
]
4242

43-
// SOURCE=E_TypeDeclaration01.fs SCFLAGS="--langversion:5.0 --test:ErrorRanges" COMPILE_ONLY=1 # E_TypeDeclaration01.fs
43+
// SOURCE=E_TypeDeclaration01.fs SCFLAGS="--langversion:8.0 --test:ErrorRanges" COMPILE_ONLY=1 # E_TypeDeclaration01.fs
4444
[<Theory; FileInlineData("E_TypeDeclaration01.fs")>]
4545
let ``E_TypeDeclaration01`` compilation =
4646
compilation

0 commit comments

Comments
 (0)