solidity/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_1d.sol
2022-05-03 14:23:27 +02:00

23 lines
360 B
Solidity

contract C {
uint[] b;
function f() public {
require(b.length == 0);
b.push() = 1;
assert(b[0] == 1);
}
function g() public {
b.push() = 1;
assert(b[b.length - 1] == 1);
// Fails
assert(b[b.length - 1] == 100);
}
}
// ====
// SMTEngine: all
// SMTIgnoreOS: macos
// ----
// Warning 6328: (199-229): CHC: Assertion violation happens here.