solidity/test/libsolidity/smtCheckerTests/functions/getters/contract.sol

16 lines
372 B
Solidity
Raw Normal View History

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
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
// ----
2021-03-31 15:11:54 +00:00
// Warning 6328: (123-158): CHC: Assertion violation happens here.\nCounterexample:\nd = 0\ne = 0\n\nTransaction trace:\nC.constructor()\nState: d = 0\nC.f()