solidity/test/libsolidity/semanticTests/abiEncoderV2/calldata_struct_member_offset.sol
2020-11-24 14:57:45 +01:00

26 lines
529 B
Solidity

pragma abicoder v2;
contract C {
struct A {
uint256 a;
uint256[] b;
}
struct B {
A a;
uint256 b;
}
function g(B calldata b) external pure returns(uint256) {
return b.b;
}
function f() public view returns(uint256, uint256) {
uint256[] memory arr = new uint256[](20);
arr[0] = 31; arr[2] = 84;
B memory b = B(A(420, arr), 11);
return (b.b, this.g(b));
}
}
// ====
// compileViaYul: also
// ----
// f() -> 11, 11