solidity/test/libsolidity/semanticTests/virtualFunctions/virtual_function_calls.sol
2022-05-19 20:23:28 +02:00

23 lines
344 B
Solidity

contract Base {
function f() public returns (uint256 i) {
return g();
}
function g() public virtual returns (uint256 i) {
return 1;
}
}
contract Derived is Base {
function g() public override returns (uint256 i) {
return 2;
}
}
// ====
// compileToEwasm: also
// ----
// g() -> 2
// f() -> 2