solidity/test/libsolidity/semanticTests/tryCatch/return_function.sol

20 lines
568 B
Solidity
Raw Normal View History

2019-09-03 16:31:17 +00:00
contract C {
function g() public returns (uint a, function() external h, uint b) {
a = 1;
h = this.fun;
b = 9;
}
function f() public returns (uint, function() external, uint) {
// Note that the function type uses two stack slots.
try this.g() returns (uint a, function() external h, uint b) {
return (a, h, b);
} catch {
}
}
function fun() public pure {}
}
// ====
// compileViaYul: also
2019-09-03 16:31:17 +00:00
// ----
// f() -> 0x1, 0xfdd67305928fcac8d213d1e47bfa6165cd0b87b946644cd0000000000000000, 9