solidity/test/libsolidity/semanticTests/calldata/calldata_bound_bytes.sol
2022-05-19 20:23:28 +02:00

19 lines
391 B
Solidity

pragma abicoder v2;
library L {
function reverse(bytes calldata _b) internal pure returns (bytes1, bytes1) {
return (_b[1], _b[0]);
}
}
contract C {
using L for bytes;
function test(uint, bytes calldata _b, uint) external pure returns (bytes1, bytes1) {
return _b.reverse();
}
}
// ----
// test(uint256,bytes,uint256): 7, 0x60, 4, 2, "ab" -> "b", "a"