Skip to content

Conversation

@T-Gro
Copy link
Member

@T-Gro T-Gro commented Jan 19, 2026

This builds up on the "Remove ML compat" PR from @kerams which added an error for very old ( > 4 versions) language versions targeted by latest SDK (older SDK, such as 10.0.100, still supports that).

The special env var for skipping the check will continue to be supported, but this codebase will no longer use it at CI time.

(it also caused problems with local development with or without agents when not was not obvious to set this env var prior ti test run)

T-Gro added 30 commits January 15, 2026 07:18
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.
…Preview

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
…ersionPreview

- 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
- RequiredAndInitOnlyProperties.fs: 15 withLangVersion70 -> withLangVersion80
- StaticsInInterfaces.fs: 8 withLangVersion70 -> withLangVersion80
- VisibilityTests.fs: 4 withLangVersion70 + 4 withLangVersion50 -> 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
- 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
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
- 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
- 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"
- 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
… 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
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.
- 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#)
- 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.
- 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
…on 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
- BasicConstants.fs: Update 4 occurrences of --langversion:5.0 to 8.0
- ComputationExpressions.fs: Update 1 occurrence of /langversion:4.7 to 8.0
…tructure

- 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
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.
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.
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.
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.
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
…le 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
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.
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.
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
T-Gro added 6 commits January 16, 2026 16:26
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 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
@github-actions
Copy link
Contributor

✅ No release notes required

T-Gro added 4 commits January 19, 2026 16:38
- 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
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.
- 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+
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Jan 19, 2026
T-Gro added 7 commits January 20, 2026 10:20
- 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
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 '[').
Use '= myList' as squiggly - unique to line 2 and ends before '['.
The codefix expands forward to find '[' then appends '.' to the span.
@T-Gro T-Gro marked this pull request as ready for review January 21, 2026 13:55
@T-Gro T-Gro requested a review from a team as a code owner January 21, 2026 13:55
@T-Gro T-Gro merged commit 162c811 into main Jan 21, 2026
6 of 40 checks passed
@T-Gro T-Gro deleted the langversion-in-tests branch January 21, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants