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

21 lines
310 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();
}
}
// ====
// compileViaYul: also
// ----
// constructor(): 2 ->
// f() -> 2