solidity/test/libsolidity/smtCheckerTests/operators/delete_struct.sol

20 lines
208 B
Solidity
Raw Normal View History

2019-05-06 16:24:15 +00:00
pragma experimental SMTChecker;
contract C
{
struct S
{
uint x;
}
2020-08-25 14:58:25 +00:00
function f(bool b) public pure {
2019-05-06 16:24:15 +00:00
S memory s;
s.x = 2;
if (b)
delete s;
else
delete s.x;
assert(s.x == 0);
}
}
// ----