mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
44da8507b1
Co-authored-by: Rodrigo Q. Saramago <rodrigoqsaramago@gmail.com>
22 lines
359 B
Solidity
22 lines
359 B
Solidity
contract C {
|
|
uint public i;
|
|
constructor(uint newI) {
|
|
i = newI;
|
|
}
|
|
}
|
|
contract D {
|
|
C c;
|
|
constructor(uint v) {
|
|
c = new C(v);
|
|
}
|
|
function f() public returns (uint r) {
|
|
return c.i();
|
|
}
|
|
}
|
|
// ----
|
|
// constructor(): 2 ->
|
|
// gas irOptimized: 193985
|
|
// gas legacy: 241212
|
|
// gas legacyOptimized: 192949
|
|
// f() -> 2
|