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

Fix #6061 — delay analysis of array value except when unpacking #6081

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

muglug
Copy link
Collaborator

@muglug muglug commented Jul 12, 2021

This undoes a mistake made in 3f2d57c.

cc @orklah — I think this fix is preferable to yours (unless there's something I've missed)

@orklah
Copy link
Collaborator

orklah commented Jul 12, 2021

Right, makes sense and it's more readable. Thanks!

@orklah
Copy link
Collaborator

orklah commented Jul 12, 2021

Does this also fix the UnusedVariable issue? Can you point me the solution if it does?

@muglug
Copy link
Collaborator Author

muglug commented Jul 12, 2021

@orklah

Does this also fix the UnusedVariable issue? Can you point me the solution if it does?

Yes, see attached test!

Changing the order of analysis is all that's necessary for the control-flow issues to be resolved. The bug was that values were analysed before keys, which also screws up variable use detection.

@muglug muglug merged commit f2bc691 into master Jul 12, 2021
@muglug muglug deleted the fix-array-key-analysis branch July 12, 2021 21:05
@orklah
Copy link
Collaborator

orklah commented Jul 12, 2021

The bug was that values were analysed before keys, which also screws up variable use detection.

I must have messed up somewhere then, My solution still had UnusedVariable issue even though I inverted the value and key analysis.

Thanks for the explanation!

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.

None yet

2 participants