Skip to content

Conversation

@heathdutton
Copy link

Fixes #16190

When a local variable is declared in a block that ends before another local variable with the same name is declared at function scope, the compiler incorrectly warns that the first variable shadows the second.

This PR skips shadow warnings for local variables where the outer declaration appears after the inner declaration in source order, since the outer variable was not visible when the inner one was declared.

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect "This declaration shadows and existing declaration" warning for mutually inaccesible declarations

1 participant