solidity/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol
2020-09-09 16:14:21 +02:00

31 lines
581 B
Solidity

pragma experimental SMTChecker;
contract C {
uint a;
constructor(uint x) {
a = x;
}
}
abstract contract B1 is C {
constructor(uint x) {
a = x;
}
}
contract B2 is C {
constructor(uint x) C(x + 2) {
a = x;
}
}
contract A is B2, B1 {
constructor(uint x) B1(x) B2(x) {
assert(a == x);
assert(a == x + 1);
}
}
// ----
// Warning 4984: (200-205): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (314-319): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (302-320): Assertion violation happens here.