Skip to content

Remove always-on language feature flag: RelaxWhitespace2 - #20320

Merged
T-Gro merged 3 commits into
mainfrom
fix/issue-20160
Aug 24, 2026
Merged

Remove always-on language feature flag: RelaxWhitespace2#20320
T-Gro merged 3 commits into
mainfrom
fix/issue-20160

Conversation

@T-Gro

@T-Gro T-Gro commented Aug 21, 2026

Copy link
Copy Markdown
Member

Fixes #20160

RelaxWhitespace2 has been on for every accepted --langversion since F# 6.0, so its flag could never be turned off. Removed the dead feature and collapsed the lexer's guarded branches to their enabled behaviour. --disableLanguageFeature:RelaxWhitespace2 is no longer a recognised feature name.

Part of #20139.

@github-actions

github-actions Bot commented Aug 21, 2026

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

@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Aug 21, 2026
@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Aug 21, 2026
Copilot and others added 2 commits August 24, 2026 12:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@T-Gro
T-Gro enabled auto-merge (squash) August 24, 2026 13:44
@T-Gro
T-Gro requested a review from abonie August 24, 2026 13:44
@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling Aug 24, 2026
@T-Gro
T-Gro merged commit 4507f94 into main Aug 24, 2026
52 checks passed
nojaf added a commit to fsprojects/fantomas that referenced this pull request Aug 27, 2026
…e2', commit 4507f94a47b615329ba5ebd6afab5846ae3d898e

This also takes in 'Extension members solve SRTP constraints (continuation)',
commit 7727673ea13f0e09aa46abf6093da050cd16bc3a (dotnet/fsharp#19602), which
changed the name of a `SynComponentInfo` from a `LongIdent` to a `SynType option`
so that extension members can be declared on tuple types:

    type (int * int) with
        member this.Sum = fst this + snd this

    type struct (int * int) with
        member this.Sum = fst this + snd this

`TypeNameNode.Identifier` is now a `Type` rather than an `IdentListNode`, built
through `mkType`, so an ordinary name becomes `Type.LongIdent` and the tuple
forms become `Type.Paren(Type.Tuple ...)` and `Type.StructTuple`. The printer
uses `genType` for it, so the tuple prints as written and no layout decision
was added. A nested module keeps an `IdentListNode` for its name, through
`mkModuleName`, since a module name can only be an identifier. The parser only
leaves the name out while recovering from a parse error, which never reaches
the transformation, so that case is an invariant violation.

The RelaxWhitespace2 commit (dotnet/fsharp#20320) only removes a dead feature
flag from LexFilter and needed no change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed NO_RELEASE_NOTES Label 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.

Remove always-on language feature flag: RelaxWhitespace2

2 participants