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

feat: variable declaration statements are not allowed as the body of loop #158

Merged
merged 22 commits into from
Dec 10, 2024

Conversation

TilakMaddy
Copy link
Contributor

crates/sema/src/ast_passes.rs Outdated Show resolved Hide resolved
tests/ui/resolve/loops.sol Outdated Show resolved Hide resolved
@TilakMaddy TilakMaddy requested a review from DaniPopes December 9, 2024 12:17
crates/sema/src/ast_passes/utils.rs Outdated Show resolved Hide resolved
crates/sema/src/ast_passes/utils.rs Outdated Show resolved Hide resolved
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TilakMaddy
Copy link
Contributor Author

TilakMaddy commented Dec 10, 2024

Well let me also change the error message in case of if statement. We can't say "... as body of the loop"
It's now

error: variable declarations can only be used inside blocks

Got it from here https://github.com/ethereum/solidity/blob/a62a455039120da834fd5faac2e0db8fc222c10d/libsolidity/analysis/SyntaxChecker.cpp#L194C68-L194C120

@TilakMaddy TilakMaddy requested a review from DaniPopes December 10, 2024 18:18
@TilakMaddy
Copy link
Contributor Author

TilakMaddy commented Dec 10, 2024

Merged main + I have also cleaned some changes that happened in loop.sol due to auto-formatting. Now it's a lot more clearer what changes this PR introduces : )

TilakMaddy and others added 2 commits December 11, 2024 00:16
Visit the inner fields using `walk_stmt` or falling through to the default one.
@DaniPopes DaniPopes enabled auto-merge (squash) December 10, 2024 18:49
@DaniPopes DaniPopes merged commit fd68e05 into paradigmxyz:main Dec 10, 2024
12 checks passed
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