Skip to content

Add computation-expression tests for warning 20 range#19992

Open
T-Gro wants to merge 2 commits into
mainfrom
copilot/fix-warning-20-let-binding-range
Open

Add computation-expression tests for warning 20 range#19992
T-Gro wants to merge 2 commits into
mainfrom
copilot/fix-warning-20-let-binding-range

Conversation

@T-Gro

@T-Gro T-Gro commented Jun 24, 2026

Copy link
Copy Markdown
Member

Test-only follow-up to #19896, adding the computation-expression coverage requested in review.

Inside a CE the loop body is desugared per-statement, so the trailing expression reaches TcStmt on its own and warning 20 highlights only the offending expression. async/task warn on the value alone; seq treats it as an implicit yield, so it doesn't warn at all.

…19896)

Answers @auduchinok's open question on PR #19896: in a computation
expression the loop body is desugared per-statement, so the trailing
expression reaches TcStmt on its own and warning 20 highlights only the
offending expression (e.g. 'x'), same as the non-CE case.

- async CE: asserts the squiggle lands on 'x' alone (Line 6, Col 13-14).
- seq CE: trailing non-unit value is an implicit yield, so no warning 20.

The CE test originally requested in review was removed in 0127569; this
reinstates a genuine CE case plus the seq implicit-yield contrast.

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

github-actions Bot commented Jun 24, 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

@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Jun 24, 2026
@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Jun 25, 2026
@T-Gro T-Gro requested a review from abonie June 25, 2026 13:53
@T-Gro T-Gro enabled auto-merge (squash) June 25, 2026 13:53
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

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant