solidity/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment.sol

19 lines
315 B
Solidity
Raw Normal View History

2020-04-14 09:09:38 +00:00
contract C {
uint[] arr;
2021-03-23 18:15:14 +00:00
constructor() {
arr.push();
arr.push();
arr.push();
arr.push();
}
2020-04-14 09:09:38 +00:00
function f() public view {
uint[] memory arr2 = arr;
arr2[2] = 3;
assert(arr.length == arr2.length);
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
// ----
2021-10-06 09:53:03 +00:00
// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 2)\n