solidity/test/libsolidity/semanticTests/calldata/calldata_internal_library.sol

23 lines
498 B
Solidity
Raw Normal View History

2020-05-25 17:30:42 +00:00
library L {
2020-12-14 17:34:40 +00:00
function f(uint, bytes calldata _x, uint) internal returns (bytes1) {
2020-05-25 17:30:42 +00:00
return _x[2];
}
}
contract C {
function f(bytes calldata a)
external
2020-12-14 17:34:40 +00:00
returns (bytes1)
2020-05-25 17:30:42 +00:00
{
return L.f(3, a, 9);
}
2020-12-14 17:34:40 +00:00
function g() public returns (bytes1) {
2020-05-25 17:30:42 +00:00
bytes memory x = new bytes(4);
x[2] = 0x08;
return this.f(x);
}
}
// ====
// compileViaYul: also
// ----
// g() -> 0x0800000000000000000000000000000000000000000000000000000000000000