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 ->
// gas irOptimized: 193999
// gas legacy: 241234
// gas legacyOptimized: 192961
// f() -> 2