solidity/test/libsolidity/smtCheckerTests/types/mapping_aliasing_1.sol
2020-07-23 18:49:03 +02:00

20 lines
362 B
Solidity

pragma experimental SMTChecker;
contract C
{
mapping (uint => uint) a;
mapping (uint => uint) b;
function f(uint x) public {
a[1] = x;
b[1] = x;
a[1] = 2;
mapping (uint => uint) storage c = a;
assert(c[1] == 2);
// False negative! Needs aliasing.
assert(a[1] == b[1]);
}
}
// ----
// Warning 6328: (266-286): Assertion violation happens here