aboutsummaryrefslogtreecommitdiff
path: root/test/map.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-03-23 18:32:37 -0700
committerRuss Cox <rsc@golang.org>2009-03-23 18:32:37 -0700
commit86145611b0ad8c6ef6923f65f8a4fd39f07f69d7 (patch)
tree0082f9d1b1e6adb4db63f2430cd84f8f82cd4ff6 /test/map.go
parent8d44052b6dd9e27a5230f66239681cec601d3a8e (diff)
downloadgo-86145611b0ad8c6ef6923f65f8a4fd39f07f69d7.tar.gz
go-86145611b0ad8c6ef6923f65f8a4fd39f07f69d7.zip
allow range on nil maps
R=ken OCL=26663 CL=26663
Diffstat (limited to 'test/map.go')
-rw-r--r--test/map.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/map.go b/test/map.go
index 085502bf52..95da48c75d 100644
--- a/test/map.go
+++ b/test/map.go
@@ -487,4 +487,10 @@ func main() {
fmt.Printf("update mipM[%d][%d] = %i\n", i, i, mipM[i][i]);
}
}
+
+ // test range on nil map
+ var mnil map[string] int;
+ for x, y := range mnil {
+ panic("range mnil");
+ }
}