solidity/test/libsolidity/smtCheckerTests/types/mapping_aliasing_1.sol

16 lines
267 B
Solidity
Raw Normal View History

2018-11-09 16:06:30 +00:00
pragma experimental SMTChecker;
contract C
{
mapping (uint => uint) a;
mapping (uint => uint) b;
function f() public {
require(a[1] == b[1]);
mapping (uint => uint) storage c = a;
c[1] = 2;
// False negative! Needs aliasing.
assert(a[1] == b[1]);
}
}