solidity/test/libsolidity/smtCheckerTests/functions/getters/contract.sol
2020-12-09 19:55:18 +01:00

16 lines
372 B
Solidity

pragma experimental SMTChecker;
contract D {}
contract C {
D public d;
function f() public view {
D e = this.d();
assert(e == d); // should hold
assert(address(e) == address(this)); // should fail
}
}
// ----
// Warning 6328: (156-191): CHC: Assertion violation happens here.\nCounterexample:\nd = 0\n\n\n\nTransaction trace:\nconstructor()\nState: d = 0\nf()