solidity/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_8.sol

19 lines
338 B
Solidity
Raw Normal View History

2021-01-25 17:17:56 +00:00
abstract contract A {
uint x;
function f() public view {
assert(x == 2);
}
}
contract C is A {
function g() public {
x = 2;
f();
x = 0;
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2021-01-25 17:17:56 +00:00
// ----
2021-03-31 15:11:54 +00:00
// Warning 6328: (61-75): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nA.f()