Skip to content

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