solidity/test/libsolidity/smtCheckerTests/inheritance/implicit_constructor_hierarchy.sol
2021-10-26 11:30:30 +02:00

20 lines
329 B
Solidity

contract A {
uint x;
constructor (uint y) { assert(x == 0); x = y; }
}
contract B is A {
constructor () A(2) { assert(x == 2); }
}
contract C is B {
function f() public view {
assert(x == 2);
}
}
// ====
// SMTEngine: all
// SMTSolvers: z3
// ----
// Info 1180: Contract invariant(s) for :C:\n(!(x <= 1) && !(x >= 3))\n