solidity/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol

29 lines
503 B
Solidity
Raw Normal View History

contract A {
uint public i;
uint public k;
2020-06-23 12:14:24 +00:00
constructor(uint newI, uint newK) {
i = newI;
k = newK;
}
}
abstract contract B is A {
uint public j;
2020-06-23 12:14:24 +00:00
constructor(uint newJ) {
j = newJ;
}
}
contract C is A {
2020-06-23 12:14:24 +00:00
constructor(uint newI, uint newK) A(newI, newK) {}
}
contract D is B, C {
2020-06-23 12:14:24 +00:00
constructor(uint newI, uint newK) B(newI) C(newI, newK + 1) {}
}
// ====
// compileViaYul: also
// ----
// constructor(): 2, 0 ->
// i() -> 2
// j() -> 2
// k() -> 1