solidity/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/bug10821-if.sol
2022-04-01 23:41:18 -05:00

14 lines
346 B
Solidity

contract Test {
struct Sample { bool flag; }
Sample public s;
function testFunc() external {
if(true){}
Sample storage t;
t.flag=true;
}
}
// ----
// TypeError 3464: (155-156='t'): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.