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

12 lines
311 B
Solidity

contract C {
struct S { uint a; }
S s;
function f() internal returns (S storage r)
{
r.a = 0;
r = s;
}
}
// ----
// TypeError 3464: (109-110='r'): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.