solidity/test/libsolidity/semanticTests/viaYul/function_pointers.sol

26 lines
545 B
Solidity
Raw Normal View History

2020-03-02 20:42:46 +00:00
contract C {
function f() public {
function() internal returns (uint) _f;
_f();
}
function g() public {
function() external returns (uint) _g;
_g();
}
function h1() internal returns (function() internal returns (uint) _h) {}
function h2() public {
h1()();
}
function k1() internal returns (function() external returns (uint) _k) {}
function k2() public {
k1()();
}
}
// ====
// compileToEwasm: also
2020-03-02 20:42:46 +00:00
// ----
2020-10-13 11:28:39 +00:00
// f() -> FAILURE, hex"4e487b71", 0x51
2020-03-02 20:42:46 +00:00
// g() -> FAILURE
2020-10-13 11:28:39 +00:00
// h2() -> FAILURE, hex"4e487b71", 0x51
2020-03-02 20:42:46 +00:00
// k2() -> FAILURE