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

20 lines
201 B
Solidity
Raw Normal View History

2019-05-06 16:24:15 +00:00
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);
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2019-05-06 16:24:15 +00:00
// ----