Skip to content

Support narrowing for if (y = x) assignment in condition#428

Merged
mame merged 1 commit intomasterfrom
if-assign-narrowing
Apr 7, 2026
Merged

Support narrowing for if (y = x) assignment in condition#428
mame merged 1 commit intomasterfrom
if-assign-narrowing

Conversation

@mame
Copy link
Copy Markdown
Member

@mame mame commented Apr 7, 2026

LocalVariableWriteNode now provides narrowings for the assigned variable, so if (y = x) correctly narrows y to non-nil in the then branch.

LocalVariableWriteNode now provides narrowings for the assigned
variable, so `if (y = x)` correctly narrows y to non-nil in the
then branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mame mame enabled auto-merge (rebase) April 7, 2026 09:57
@mame mame merged commit 9adbaa7 into master Apr 7, 2026
12 checks passed
@mame mame deleted the if-assign-narrowing branch April 7, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant