Skip to content
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

Recognize that variable vars are not assignments #88

Merged
merged 2 commits into from
May 10, 2019
Merged

Conversation

sirbrillig
Copy link
Owner

When a variable variable is used as the left side of an assignment, there are actually two variables being checked: there is the current one, and the variable one whose name is the value of the current one.

In this case, we must not treat the current one as an assignment; it is actually a read. This change updates the logic so that this is the case.

Fixes #84

This does not address the issue that variable variables are not marked as used (see #87).

When a variable variable is used as the left side of an assignment,
there are actually two variables being checked: there is the current
one, and the variable one whose name is the value of the current one.

In this case, we must not treat the current one as an assignment; it is
actually a read. This change updates the logic so that this is the
case.
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.

Variable variables are considered unused on assignment left-hand side
1 participant