mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
38 lines
601 B
Solidity
38 lines
601 B
Solidity
contract A {
|
|
function f() public virtual returns (uint256 r) {
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
contract B is A {
|
|
function f() public virtual override returns (uint256 r) {
|
|
return super.f() | 2;
|
|
}
|
|
}
|
|
|
|
|
|
contract C is A {
|
|
function f() public virtual override returns (uint256 r) {
|
|
return super.f() | 4;
|
|
}
|
|
}
|
|
|
|
|
|
contract D is B, C {
|
|
uint256 data;
|
|
|
|
constructor() {
|
|
data = super.f() | 8;
|
|
}
|
|
|
|
function f() public override (B, C) returns (uint256 r) {
|
|
return data;
|
|
}
|
|
}
|
|
// ====
|
|
// compileViaYul: also
|
|
// compileToEwasm: also
|
|
// ----
|
|
// f() -> 15
|