Description
I get shadow declaration warnings for variable definitions that are defined in separate scopes. That cannot possible refer to each other.
Environment
- Compiler version: 0.8.29
- Compilation pipeline (legacy, IR, EOF): legacy
- Target EVM version (as per compiler settings): cancun
- Framework/IDE (e.g. Foundry, Hardhat, Remix): foundryj
- Operating system: MacOS
Steps to Reproduce
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Bob {
function myFunc() external view returns (uint256) {
{
uint256 x = 34;
x -= address(this).balance;
}
uint256 x = 33 + 2;
return x;
}
}