compiler: allow usage of string literals in index expressions

This commit is contained in:
Evgenii Stratonikov 2020-01-23 17:28:35 +03:00
parent 058958729d
commit 4fd766fe09
2 changed files with 48 additions and 21 deletions

View file

@ -39,6 +39,22 @@ var mapTestCases = []testCase{
`,
big.NewInt(4),
},
{
"map with string index",
`
package foo
func Main() string {
t := map[string]string{
"name": "Valera",
"age": "33",
}
name := t["name"]
return name
}
`,
[]byte("Valera"),
},
}
func TestMaps(t *testing.T) {