mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
12 lines
349 B
Solidity
12 lines
349 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: (96-107): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|