solidity/test/libsolidity/semanticTests/array/inline_array_strings_from_document.sol
2020-11-02 23:10:03 +01:00

15 lines
352 B
Solidity

contract C {
function f(uint256 i) public returns (string memory) {
string[4] memory x = ["This", "is", "an", "array"];
return (x[i]);
}
}
// ====
// compileViaYul: 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"