solidity/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol
Daniel Kirchner 4b9c01752d Test updates.
2022-03-16 15:34:38 +01:00

32 lines
583 B
Solidity

contract A {
uint public i;
uint public k;
constructor(uint newI, uint newK) {
i = newI;
k = newK;
}
}
abstract contract B is A {
uint public j;
constructor(uint newJ) {
j = newJ;
}
}
contract C is A {
constructor(uint newI, uint newK) A(newI, newK) {}
}
contract D is B, C {
constructor(uint newI, uint newK) B(newI) C(newI, newK + 1) {}
}
// ====
// compileViaYul: also
// ----
// constructor(): 2, 0 ->
// gas irOptimized: 156071
// gas legacy: 170665
// gas legacyOptimized: 145396
// i() -> 2
// j() -> 2
// k() -> 1