mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
20 lines
293 B
Solidity
20 lines
293 B
Solidity
contract A {
|
|
uint public x = 0;
|
|
uint y = f();
|
|
function f() public returns (uint256) {
|
|
++x;
|
|
return 42;
|
|
}
|
|
}
|
|
contract B is A {
|
|
uint public z;
|
|
constructor() {
|
|
z = x;
|
|
}
|
|
}
|
|
// ====
|
|
// compileToEwasm: also
|
|
// compileViaYul: also
|
|
// ----
|
|
// z() -> 1
|