Skip to content

Conversation

@som-snytt
Copy link
Contributor

Fixes #24280

In an assign i = f(i), the rhs i is not taken as a read because an enclosing context is an assign to i and the position of the reference is enclosed by the assign tree.

At Assign, context receives the tree so that variable lookup
detects assignment by target symbol and by position.
@som-snytt som-snytt force-pushed the issue/24280-read-in-assign branch from df4f905 to c381374 Compare December 7, 2025 11:32
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.

False negative "mutated but not read" when read is RHS of assign

1 participant