mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
21 lines
324 B
Solidity
21 lines
324 B
Solidity
|
contract C {
|
||
|
uint public i;
|
||
|
constructor(uint newI) public {
|
||
|
i = newI;
|
||
|
}
|
||
|
}
|
||
|
contract D {
|
||
|
C c;
|
||
|
constructor(uint v) public {
|
||
|
c = new C(v);
|
||
|
}
|
||
|
function f() public returns (uint r) {
|
||
|
return c.i();
|
||
|
}
|
||
|
}
|
||
|
// ====
|
||
|
// compileViaYul: also
|
||
|
// ----
|
||
|
// constructor(): 2 ->
|
||
|
// f() -> 2
|