mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
159f50e189
These were marked IR-only, but they do pass on the old codegen too. Also add old codegen version of semantictests/revertStrings/function_entry_checks.
34 lines
650 B
Solidity
34 lines
650 B
Solidity
contract X {
|
|
function f() public returns (uint x) {
|
|
x = g();
|
|
}
|
|
function g() public virtual returns (uint x) {
|
|
x = 2;
|
|
}
|
|
}
|
|
contract C is X {
|
|
function f1() public returns (uint x) {
|
|
// direct call
|
|
x = g();
|
|
}
|
|
function f2() public returns (uint x) {
|
|
// call via base
|
|
x = f();
|
|
}
|
|
function f3() public returns (uint x) {
|
|
// explicit call via base
|
|
//x = super.g();
|
|
}
|
|
function g() public override returns (uint x) {
|
|
x = 3;
|
|
}
|
|
}
|
|
// ====
|
|
// compileViaYul: also
|
|
// compileToEwasm: also
|
|
// ----
|
|
// f() -> 3
|
|
// f1() -> 3
|
|
// f2() -> 3
|
|
// g() -> 3
|