Shadowing warning between local variables or function depend on declaration order
Open
bug :bug:
low impact
medium effort
nice to have
should report better error
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 21
Description
Example:
```
contract C {
// no shadowing warning
function f() public pure { uint x; }
function x() public pure {}
}
```
```
contract C {
function x() public pure {}
// shadowing warning
function f() public pure { uint x; }
}
```
Discovered by @k06a
Contributor guide
Research direction
Reproduce both contract examples with the Solidity compiler and compare the shadowing warnings as declaration order changes. Trace the warning implementation from that behavior; done means the warning no longer depends on whether function x is declared before or after local variable x.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100