solidity/test/libsolidity/semanticTests/array/inline_array_strings_from_document.sol
2022-05-19 20:23:28 +02:00

15 lines
353 B
Solidity

contract C {
function f(uint256 i) public returns (string memory) {
string[4] memory x = ["This", "is", "an", "array"];
return (x[i]);
}
}
// ====
// compileToEwasm: also
// ----
// f(uint256): 0 -> 0x20, 0x4, "This"
// f(uint256): 1 -> 0x20, 0x2, "is"
// f(uint256): 2 -> 0x20, 0x2, "an"
// f(uint256): 3 -> 0x20, 0x5, "array"