solidity/test/libsolidity/semanticTests/getters/mapping_of_string.sol

19 lines
498 B
Solidity
Raw Normal View History

2020-06-03 19:47:24 +00:00
contract C {
mapping(string => uint8[3]) public x;
2020-06-23 12:14:24 +00:00
constructor() {
2020-06-03 19:47:24 +00:00
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