mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
runtime: allow ranging over a nil map
This appears to be allowed by the specification, at least it is allowed by the main Go implementation: https://play.golang.org/p/S8jxAMytKDB Allow it in TinyGo too, for consistency. Found because it is triggered with `tinygo test flags`. This doesn't make the flags package pass all tests, but is a step closer.
This commit is contained in:
committed by
Ron Evans
parent
69e1aa4878
commit
e99b8a24fe
Vendored
+3
@@ -49,6 +49,9 @@ func main() {
|
||||
println(testmapIntInt[2])
|
||||
testmapIntInt[2] = 42
|
||||
println(testmapIntInt[2])
|
||||
for k := range nilmap {
|
||||
println(k) // unreachable
|
||||
}
|
||||
|
||||
arrKey := ArrayKey([4]byte{4, 3, 2, 1})
|
||||
println(testMapArrayKey[arrKey])
|
||||
|
||||
Reference in New Issue
Block a user