solidity/test/libsolidity/semanticTests/structs/calldata/dynamic_nested.sol
2020-07-20 15:40:58 +02:00

14 lines
382 B
Solidity

pragma experimental ABIEncoderV2;
contract C {
struct S2 { uint256 b; }
struct S { uint256 a; S2[] children; }
function f(S calldata s) external pure returns (uint256, uint256, uint256, uint256) {
return (s.children.length, s.a, s.children[0].b, s.children[1].b);
}
}
// ====
// compileViaYul: also
// ----
// f((uint256,(uint256)[])): 32, 17, 64, 2, 23, 42 -> 2, 17, 23, 42