Skip to content

Fix nullness narrowing in match inside comprehensions#19743

Open
T-Gro wants to merge 2 commits into
mainfrom
fix/nullness-match-infer
Open

Fix nullness narrowing in match inside comprehensions#19743
T-Gro wants to merge 2 commits into
mainfrom
fix/nullness-match-infer

Conversation

@T-Gro
Copy link
Copy Markdown
Member

@T-Gro T-Gro commented May 15, 2026

Fix false-positive FS3261 when pattern matching narrows nullness inside seq/list/array comprehensions.

Fixes #19644

…#19644)

Extract null-narrowing helper EliminateNullnessFromInputType from
TcMatchClause and reuse it in TcSequenceExpression's SynExpr.Match
handler so the input type is narrowed across clauses inside
comprehensions, matching the behavior of plain match expressions.

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

github-actions Bot commented May 15, 2026

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@T-Gro T-Gro requested a review from abonie May 15, 2026 12:26
@T-Gro T-Gro added AI-Auto-Resolve-Conflicts Opt-in: LabelOps merges main into this PR and resolves conflicts every 3h AI-Auto-Resolve-CI Opt-in: LabelOps triages CI failures on this PR every 3h labels May 15, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label May 15, 2026
@github-actions github-actions Bot mentioned this pull request May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Auto-Resolve-CI Opt-in: LabelOps triages CI failures on this PR every 3h AI-Auto-Resolve-Conflicts Opt-in: LabelOps merges main into this PR and resolves conflicts every 3h AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Nullness issue - Apparently incorrect 3261 in match arm

1 participant