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

13 lines
321 B
Solidity
Raw Normal View History

2020-05-25 17:30:42 +00:00
contract C {
2020-12-14 17:34:40 +00:00
function f(bytes calldata b, uint i) internal pure returns (bytes1) {
2020-05-25 17:30:42 +00:00
return b[i];
}
2020-12-14 17:34:40 +00:00
function f(uint, bytes calldata b, uint) external pure returns (bytes1) {
2020-05-25 17:30:42 +00:00
return f(b, 2);
}
}
// ====
// compileViaYul: also
// ----
// f(uint256,bytes,uint256): 7, 0x60, 7, 4, "abcd" -> "c"