mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
22 lines
595 B
Solidity
22 lines
595 B
Solidity
library D {
|
|
function f(bytes calldata _x) public pure returns (bytes1) {
|
|
return _x[0];
|
|
}
|
|
function g(bytes memory _x) public pure returns (bytes1) {
|
|
return _x[0];
|
|
}
|
|
}
|
|
|
|
contract C {
|
|
using D for bytes;
|
|
function f(bytes calldata _x) public pure returns (bytes1, bytes1) {
|
|
return (_x.f(), _x.g());
|
|
}
|
|
}
|
|
// ====
|
|
// EVMVersion: >homestead
|
|
// compileViaYul: also
|
|
// ----
|
|
// library: D
|
|
// f(bytes): 0x20, 4, "abcd" -> 0x6100000000000000000000000000000000000000000000000000000000000000, 0x6100000000000000000000000000000000000000000000000000000000000000
|