2020-06-10 14:46:02 +00:00
|
|
|
library D {
|
|
|
|
function f(bytes calldata _x) public pure returns (byte) {
|
|
|
|
return _x[0];
|
|
|
|
}
|
|
|
|
function g(bytes memory _x) public pure returns (byte) {
|
|
|
|
return _x[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
using D for bytes;
|
|
|
|
function f(bytes calldata _x) public pure returns (byte, byte) {
|
|
|
|
return (_x.f(), _x.g());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
2020-11-19 09:53:07 +00:00
|
|
|
// compileViaYul: also
|
2020-06-10 14:46:02 +00:00
|
|
|
// EVMVersion: >homestead
|
|
|
|
// ----
|
|
|
|
// library: D
|
|
|
|
// f(bytes): 0x20, 4, "abcd" -> 0x6100000000000000000000000000000000000000000000000000000000000000, 0x6100000000000000000000000000000000000000000000000000000000000000
|