2019-04-02 10:37:48 +00:00
|
|
|
contract X {
|
|
|
|
function f() public returns (uint x) {
|
|
|
|
x = g();
|
|
|
|
}
|
2019-11-05 17:25:34 +00:00
|
|
|
function g() public virtual returns (uint x) {
|
2019-04-02 10:37:48 +00:00
|
|
|
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();
|
|
|
|
}
|
2019-09-16 12:33:43 +00:00
|
|
|
function g() public override returns (uint x) {
|
2019-04-02 10:37:48 +00:00
|
|
|
x = 3;
|
|
|
|
}
|
|
|
|
}
|
2019-05-08 08:46:38 +00:00
|
|
|
// ====
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2019-04-02 10:37:48 +00:00
|
|
|
// ----
|
|
|
|
// f() -> 3
|
|
|
|
// f1() -> 3
|
|
|
|
// f2() -> 3
|
|
|
|
// g() -> 3
|