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

19 lines
264 B
Solidity
Raw Normal View History

pragma experimental SMTChecker;
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);
}
}
// ====
// SMTSolvers: z3