Skip to content

Set the default F# language version to 11.0 - #20219

Merged
T-Gro merged 5 commits into
mainfrom
t-gro-enable-fsharp-11-default
Aug 10, 2026
Merged

Set the default F# language version to 11.0#20219
T-Gro merged 5 commits into
mainfrom
t-gro-enable-fsharp-11-default

Conversation

@T-Gro

@T-GroT-Gro commented Aug 6, 2026

Copy link
Copy Markdown
Member

Bumps the default language version (--langversion:default / latest / latestmajor) from 10.0 to 11.0, so the features stabilized into F# 11.0 in #20199 are now on by default with a .NET 11 SDK. FromEndSlicing intentionally stays in preview.

A handful of EmittedIL/signature tests that capture the pre-11 behavior are pinned to --langversion:10.0 so their existing baselines stay valid; the 11.0 behavior of those features is already covered by the existing preview twins.

T-Groand others added 3 commits August 6, 2026 12:30
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The default language version bump to 11.0 turns on DirectDelegateConstruction,
ErrorOnMissingSignatureAttribute (FS3888 warning->error) and
ExceptionFieldSerializationSupport by default. Pin the tests that capture the
pre-11 (feature-off) behavior to --langversion:10.0 so they keep exercising it;
the 11.0 behavior is already covered by the existing preview/explicit twins.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@T-Gro
T-Gro requested a review from a team as a code ownerAugust 6, 2026 11:33
@T-GroT-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Aug 6, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

…lt bump
DirectDelegateConstruction (on by default at 11.0) collapses the
delegate-from-static-method closures these baselines expect. The 11.0
form is covered by EmittedIL/DirectDelegates. The EventHandler case is
WinForms-gated so it only surfaces on Windows CI.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Aug 6, 2026
@T-Gro
T-Gro requested a review from abonieAugust 6, 2026 12:15
@T-Gro
T-Gro enabled auto-merge (squash) August 6, 2026 12:35
Two net472/Desktop-only tests were masked off-Windows and only broke on the
Windows CI legs after the default language version moved to 11.0:
- neg12 (typecheck/sigs): AccessProtectedBaseFieldFromClosure is now on by
default, so the protected-member-from-closure cases compile and three FS0491
baseline errors vanish. Pinned to 10.0; 11.0 behavior is covered by dedicated
conformance tests.
- core/attributes (FSC_OPTIMIZED + FSI): ErrorOnMissingSignatureAttribute turns
FS3888 (attribute present on impl but not signature) from warning into error.
The test deliberately exercises this sig/impl attribute difference. Pinned to
10.0; 11.0 behavior is covered by Conformance/Signatures/SignatureEnforcedAttributes.
Adds a V10 case to the test LangVersion DU (ScriptHelpers.fs) and the two
exhaustive match sites (ScriptHelpers baseArgs, FsharpSuiteMigrated adjustVersion).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 031e1fed-5836-4262-b22e-b0ebcd96c31b
@T-Gro
T-Gro merged commit 22a8a5d into mainAug 10, 2026
48 checks passed
@github-project-automationgithub-project-automationBot moved this from New to In Progress in F# Compiler and ToolingAug 10, 2026
@github-project-automationgithub-project-automationBot moved this from In Progress to Done in F# Compiler and ToolingAug 10, 2026
let verifyCompilation compilation =
compilation
|> coreOptions
|> withLangVersion10 // default baseline captures the pre-11 closure IL; DirectDelegateConstruction (11.0) is covered by the preview twin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is likely not going to age well.

@T-Gro Should we try to not add these comments after all? I think they distract more than they help, especially because we're getting more of them.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment as well as the test can be removed once the feature is stabilized.

Until then, its good to have anything proving that:

  • both variants (feature on/off) are tested
  • what tests can be removed (rather then rewritten) when feature stabilizes

I do agree comments are not the optimal tool, maybe named function call would be better?

TLDR:
I would love to keep anything around that tells the future maintainers "this test has to be ported" vs "this test can be removed".

@T-Gro
T-Gro deleted the t-gro-enable-fsharp-11-default branch August 11, 2026 11:35
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-BypassedTooling check: non-fork PR, not diff-analyzedNO_RELEASE_NOTESLabel for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants

@T-Gro@auduchinok@abonie