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

prioritize reference id in name resolution to avoid shadowing issues #2121

Merged
merged 4 commits into from
Oct 12, 2023

Conversation

0xalpharush
Copy link
Contributor

@0xalpharush 0xalpharush commented Sep 8, 2023

replaces #2060
fixes #2058

Prior to 0.5.0 (xref ethereum/solidity#1679), the scoping rules allow references to undeclared variables so shadowing a state variable in a function body would still prioritize the yet-declared local variable. Following 0.5.0, it is no longer possible to have forward references, and the reference will be to the state variable in the case that a shadowing local declaration is declared in predecessors of the same lexical scope.

@0xalpharush 0xalpharush changed the title prioritize reference id in name resolution to avoid shadowing related… prioritize reference id in name resolution to avoid shadowing issues Sep 8, 2023
@0xalpharush 0xalpharush marked this pull request as ready for review September 8, 2023 12:50
@0xalpharush 0xalpharush marked this pull request as draft September 9, 2023 20:18
@montyly
Copy link
Member

montyly commented Oct 12, 2023

another example of why it would make sense to rewrite a parser for solidity 0.8 only :)

@montyly montyly merged commit 7d1da92 into dev Oct 12, 2023
73 checks passed
@montyly montyly deleted the fix/prioritize-reference-id branch October 12, 2023 18:37
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.

2 participants