solidity/test/libsolidity/syntaxTests/controlFlow/localStorageVariables/ternary_assignment_err.sol
2022-04-01 23:41:18 -05:00

12 lines
337 B
Solidity

contract C {
uint256[] s;
function f() public {
bool d;
uint256[] storage x;
uint256[] storage y = d ? (x = s) : x;
y;
}
}
// ----
// TypeError 3464: (145-146='x'): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.