solidity/test/libsolidity/semanticTests/getters/mapping_of_string.sol
2020-06-03 21:47:24 +02:00

19 lines
505 B
Solidity

contract C {
mapping(string => uint8[3]) public x;
constructor() public {
x["abc"][0] = 1;
x["abc"][2] = 3;
x["abc"][1] = 2;
x["def"][1] = 9;
}
}
// ====
// compileViaYul: also
// ----
// x(string,uint256): 0x40, 0, 3, "abc" -> 1
// x(string,uint256): 0x40, 1, 3, "abc" -> 2
// x(string,uint256): 0x40, 2, 3, "abc" -> 3
// x(string,uint256): 0x40, 0, 3, "def" -> 0x00
// x(string,uint256): 0x40, 1, 3, "def" -> 9
// x(string,uint256): 0x40, 2, 3, "def" -> 0x00