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

21 lines
409 B
Solidity
Raw Normal View History

contract A {
uint x;
2020-06-23 12:14:24 +00:00
constructor (uint y) { assert(x == 0); x = y; }
}
contract B is A {
2020-06-23 12:14:24 +00:00
constructor () A(2) { assert(x == 2); }
}
contract C is B {
function f() public view {
assert(x == 2);
}
}
// ====
2021-03-31 15:11:54 +00:00
// SMTEngine: all
// SMTIgnoreInv: yes
2023-02-09 16:07:13 +00:00
// SMTSolvers: z3
// ----
// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.