Skip to content

Remove the dead ImplicitYield language-feature flag - #20225

Open
T-Gro wants to merge 2 commits into
dotnet:mainfrom
T-Gro:remove-implicit-yield-feature-flag
Open

Remove the dead ImplicitYield language-feature flag#20225
T-Gro wants to merge 2 commits into
dotnet:mainfrom
T-Gro:remove-implicit-yield-feature-flag

Conversation

@T-Gro

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

Copy link
Copy Markdown
Member

LanguageFeature.ImplicitYield shipped in F# 4.7 and is permanently enabled for every accepted --langversion (the minimum accepted version is 8.0), so its guards were always true. The dead legacy branches behind the flag are collapsed to the always-on path and the flag itself is removed. No behavioural change.

Copilot and others added 2 commits August 6, 2026 14:06
LanguageFeature.ImplicitYield is permanently enabled for every accepted
langversion (min --langversion is 8.0), so the flag guard is always true.
Keep only the enabled paths and delete the dead legacy branches:

- CheckExpressionsOps.fs: collapse YieldFree to its enabled body and drop
  the now-dead cenv parameter from YieldFree, IsSimpleSemicolonSequenceElement,
  TryGetSimpleSemicolonSequenceOfComprehension and (|SimpleSemicolonSequence|_|).
- CheckSequenceExpressions.fs: drop the constant conjunct in enableImplicitYield,
  delete the dead SynExpr.Paren guard arm, and delete the dead
  validateObjectSequenceOrRecordExpression block.
- CheckArrayOrListComputedExpressions.fs: collapse the implicitYieldEnabled
  block and its nested match to the single reachable arm.
- CheckComputationExpressions.fs: drop the constant conjunct in enableImplicitYield
  (field and its branches retained) and update the YieldFree call.

The LanguageFeature.ImplicitYield definition is intentionally left in place; a
later change removes it. No behavioural change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The LanguageFeature.ImplicitYield flag shipped in F# 4.7 and is permanently
enabled (minimum accepted --langversion is 8.0), so it is dead configuration.
All enforcement sites were already collapsed to the always-on path, leaving the
flag unreferenced.

Delete the ImplicitYield union case (both .fs and .fsi), its features-map entry,
its GetFeatureString arm, and the featureImplicitYield resource string. The xlf
localization files were regenerated via /t:UpdateXlf.

The SynExpr.SequentialOrImplicitYield syntax node and related implementation are
unaffected; only the feature flag is removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev

@T-Gro,

Caution

No release notes found for the changed paths (see table below).

Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format.

The following format is recommended for this repository:

`* . (PR #XXXXX)`

See examples in the files, listed in the table below or in th full documentation at https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html.

If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

Change path Release notes path Description
`src/Compiler` docs/release-notes/.FSharp.Compiler.Service/11.0.100.md No release notes found or release notes format is not correct
`src/Compiler/Facilities/LanguageFeatures.fsi` docs/release-notes/.Language/preview.md No release notes found or release notes format is not correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant