solidity/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_2.sol
2020-03-11 16:29:07 +01:00

20 lines
430 B
Solidity

pragma experimental SMTChecker;
pragma experimental ABIEncoderV2;
contract C
{
uint[] array;
function f(uint[] memory a, uint[] memory b) public {
array[0] = 42;
a[0] = 2;
b[0] = 1;
// Erasing knowledge about memory references should not
// erase knowledge about state variables.
assert(array[0] == 42);
assert(a[0] == 2);
assert(b[0] == 1);
}
}
// ----
// Warning: (321-338): Assertion violation happens here