solidity/test/libsolidity/smtCheckerTests/operators/delete_struct.sol
2020-09-03 15:19:03 +02:00

20 lines
208 B
Solidity

pragma experimental SMTChecker;
contract C
{
struct S
{
uint x;
}
function f(bool b) public pure {
S memory s;
s.x = 2;
if (b)
delete s;
else
delete s.x;
assert(s.x == 0);
}
}
// ----