Skip to content

Improve checking LHS of Assign #22977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

Fixes #22970

Simple example showing how awkward this is compared to a traversal, where there is more control when descending.

Previously, it "ignored" the LHS of Assign to avoid taking x = y as ref to x instead of assignment to.

Now, "mark" the LHS as assignment, so transformIdent and Select set a "mode" flag, such that x is correctly taken as either a ref or assign to x.

Probably there is more complex syntax to handle as LHS, but I haven't had coffee yet.

@som-snytt som-snytt force-pushed the issue/22970-var-import branch from d38c344 to 48e3493 Compare April 11, 2025 14:27
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 positive warning: unused import when var symbol is used only as assignment target
1 participant