mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
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.
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
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
|
||||
Reference in New Issue
Block a user