diff options
author | Konstantin Yegupov <[email protected]> | 2019-01-30 23:22:29 +1000 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2019-01-31 16:34:59 +0100 |
commit | f8a1e5f4491b8206b23f351721c9b10e37526c8c (patch) | |
tree | 0a030aea7e49be6e0ffcbed1f195b733069fe26b /testdata/map.go | |
parent | 0308c92e67f833ea83c9699c78c26a192bff89dc (diff) | |
download | tinygo-f8a1e5f4491b8206b23f351721c9b10e37526c8c.tar.gz tinygo-f8a1e5f4491b8206b23f351721c9b10e37526c8c.zip |
interp: support map literals with integer keys
Diffstat (limited to 'testdata/map.go')
-rw-r--r-- | testdata/map.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/testdata/map.go b/testdata/map.go index 66699390c..5b97bf5dd 100644 --- a/testdata/map.go +++ b/testdata/map.go @@ -15,6 +15,7 @@ var testmap2 = map[string]int{ "eleven": 11, "twelve": 12, } +var testmapIntInt = map[int]int{1: 1, 2: 4, 3: 9} func main() { m := map[string]int{"answer": 42, "foo": 3} @@ -31,6 +32,9 @@ func main() { var nilmap map[string]int println(m == nil, m != nil, len(m)) println(nilmap == nil, nilmap != nil, len(nilmap)) + println(testmapIntInt[2]) + testmapIntInt[2] = 42 + println(testmapIntInt[2]) } func readMap(m map[string]int, key string) { |