solidity/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol

22 lines
359 B
Solidity
Raw Normal View History

contract C {
uint public i;
2020-06-23 12:14:24 +00:00
constructor(uint newI) {
i = newI;
}
}
contract D {
C c;
2020-06-23 12:14:24 +00:00
constructor(uint v) {
c = new C(v);
}
function f() public returns (uint r) {
return c.i();
}
}
// ----
// constructor(): 2 ->
2022-05-23 10:54:18 +00:00
// gas irOptimized: 195258
2021-11-15 15:19:33 +00:00
// gas legacy: 245842
// gas legacyOptimized: 195676
// f() -> 2