solidity/test/libsolidity/semanticTests/libraries/bound_returning_calldata_external.sol

21 lines
584 B
Solidity

library D {
function f(bytes calldata _x) public pure returns (bytes calldata) {
return _x;
}
function g(bytes calldata _x) public pure returns (bytes memory) {
return _x;
}
}
contract C {
using D for bytes;
function f(bytes calldata _x) public pure returns (byte, byte) {
return (_x.f()[0], _x.g()[0]);
}
}
// ====
// EVMVersion: >homestead
// ----
// library: D
// f(bytes): 0x20, 4, "abcd" -> 0x6100000000000000000000000000000000000000000000000000000000000000, 0x6100000000000000000000000000000000000000000000000000000000000000