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

18 lines
475 B
Solidity
Raw Normal View History

2020-11-23 18:06:44 +00:00
pragma abicoder v2;
contract C {
function f(string[] calldata a)
external
returns (uint256, uint256, uint256, string memory)
{
string memory s1 = a[0];
bytes memory m1 = bytes(s1);
return (a.length, m1.length, uint8(m1[0]), s1);
}
}
// ====
// compileViaYul: also
// ----
// f(string[]): 0x20, 0x1, 0x20, 0x2, hex"6162000000000000000000000000000000000000000000000000000000000000" -> 1, 2, 97, 0x80, 2, "ab"