solidity/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol

22 lines
384 B
Solidity
Raw Normal View History

contract C {
uint public i;
uint public k;
2020-06-23 12:14:24 +00:00
constructor(uint newI, uint newK) {
i = newI;
k = newK;
}
}
contract D is C {
2020-06-23 12:14:24 +00:00
constructor(uint newI, uint newK) C(newI, newK + 1) {}
}
// ====
// compileViaYul: also
// ----
// constructor(): 2, 0 ->
2021-11-15 15:19:33 +00:00
// gas irOptimized: 124844
// gas legacy: 139250
// gas legacyOptimized: 119367
// i() -> 2
// k() -> 1