solidity/test/libsolidity/syntaxTests/controlFlow/storageReturn/assembly/if_err.sol

12 lines
354 B
Solidity

contract C {
struct S { bool f; }
S s;
function f(bool flag) internal pure returns (S storage c) {
assembly {
if flag { c_slot := s_slot }
}
}
}
// ----
// TypeError 3464: (96-107): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.