solidity/test/libsolidity/smtCheckerTests/array_members/push_zero_unsafe.sol
2021-01-12 14:00:07 +01:00

12 lines
292 B
Solidity

pragma experimental SMTChecker;
contract C {
uint[] a;
function f() public {
a.push();
assert(a[a.length - 1] == 100);
}
}
// ----
// Warning 6328: (94-124): CHC: Assertion violation happens here.\nCounterexample:\na = [0]\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.f()