mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
23 lines
421 B
Solidity
23 lines
421 B
Solidity
pragma abicoder v2;
|
|
|
|
struct S {
|
|
uint x;
|
|
uint y;
|
|
}
|
|
|
|
library L {
|
|
function reverse(S calldata _s) internal pure returns (uint, uint) {
|
|
return (_s.y, _s.x);
|
|
}
|
|
}
|
|
|
|
contract C {
|
|
function test(uint, S calldata _s, uint) external pure returns (uint, uint) {
|
|
return L.reverse(_s);
|
|
}
|
|
}
|
|
// ====
|
|
// compileViaYul: also
|
|
// ----
|
|
// test(uint256,(uint256,uint256),uint256): 7, 66, 77, 4 -> 77, 66
|