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

23 lines
317 B
Solidity
Raw Normal View History

pragma experimental SMTChecker;
contract A {
uint x = 1;
}
contract B is A {
constructor() public { x = 2; }
}
contract C is B {
constructor() public { x = 3; }
}
contract D is C {
constructor() public {
assert(x == 3);
assert(x == 2);
}
}
// ----
// Warning: (232-246): Assertion violation happens here