solidity/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_function.sol

17 lines
409 B
Solidity
Raw Normal View History

2020-11-23 18:06:44 +00:00
pragma abicoder v2;
contract C {
struct S { function () external returns (uint) f; uint b; }
function f(S memory s) public returns (uint, uint) {
return (s.f(), s.b);
}
function test() public returns (uint, uint) {
return this.f(S(this.g, 3));
}
function g() public returns (uint) { return 7; }
}
// ====
// compileViaYul: also
// ----
// test() -> 7, 3