2020-05-26 20:18:41 +00:00
|
|
|
contract C {
|
|
|
|
function foo() internal returns (uint) {
|
|
|
|
return 42;
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_ptr(function() internal returns (uint) ptr) internal returns(function() internal returns (uint)) {
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
function associated() public returns (uint) {
|
|
|
|
// This expression directly references function definition
|
|
|
|
return (foo)();
|
|
|
|
}
|
|
|
|
|
|
|
|
function unassociated() public returns (uint) {
|
|
|
|
// This expression is not associated with a specific function definition
|
|
|
|
return (get_ptr(foo))();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2020-05-26 20:18:41 +00:00
|
|
|
// ----
|
|
|
|
// associated() -> 42
|
|
|
|
// unassociated() -> 42
|