[SMTChecker] Fix public getter for array of structs.

This commit is contained in:
Martin Blicha
2021-03-08 17:34:20 +01:00
parent 093ea4612b
commit 385a664f3c
6 changed files with 119 additions and 45 deletions
@@ -0,0 +1,22 @@
pragma abicoder v1;
pragma experimental SMTChecker;
struct Item {
uint x;
uint y;
}
contract D {
Item[] public items;
function test() public {
delete items;
items.push(Item(42, 43));
(uint a, uint b) = this.items(0);
assert(a == 42); // should hold
assert(b == 43); // should hold
assert(b == 0); // should fail
}
}
// ----
// Warning 6328: (300-314): CHC: Assertion violation happens here.\nCounterexample:\nitems = [{x: 42, y: 43}]\n\nTransaction trace:\nD.constructor()\nState: items = []\nD.test()