solidity/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls_through_dispatch.sol
Kamil Śliwak 1a2e441bc5 Generate internal dispatch only for functions that might actually get called via pointers
- This also adds support for internal library calls as a side-effect since they'll now be pulled into the internal dispatch automatically.
2020-05-26 17:01:50 +02:00

27 lines
467 B
Solidity

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