summaryrefslogtreecommitdiff
path: root/test/switch3.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-11-13 22:58:08 -0500
committerRuss Cox <rsc@golang.org>2011-11-13 22:58:08 -0500
commitdb8ca4b484a59db70309e99ca47315cfbc3ed1df (patch)
tree2b8d8891e102db77c7b7819e269970454a5eae5a /test/switch3.go
parent80f8b0e3e5649890f41f80ccf6cc2da853ac1f9b (diff)
downloadgo-db8ca4b484a59db70309e99ca47315cfbc3ed1df.tar.gz
gc: remove func, map compare
R=ken, ken CC=golang-dev http://codereview.appspot.com/5373079
Diffstat (limited to 'test/switch3.go')
-rw-r--r--test/switch3.go28
1 files changed, 24 insertions, 4 deletions
diff --git a/test/switch3.go b/test/switch3.go
index 95ff6ec3c..e91499db0 100644
--- a/test/switch3.go
+++ b/test/switch3.go
@@ -6,9 +6,8 @@
package main
-
type I interface {
- M()
+ M()
}
func bad() {
@@ -16,11 +15,32 @@ func bad() {
var s string
switch i {
- case s: // ERROR "mismatched types string and I"
+ case s: // ERROR "mismatched types string and I"
}
switch s {
- case i: // ERROR "mismatched types I and string"
+ case i: // ERROR "mismatched types I and string"
+ }
+
+ var m, m1 map[int]int
+ switch m {
+ case nil:
+ case m1: // ERROR "can only compare map m to nil"
+ default:
+ }
+
+ var a, a1 []int
+ switch a {
+ case nil:
+ case a1: // ERROR "can only compare slice a to nil"
+ default:
+ }
+
+ var f, f1 func()
+ switch f {
+ case nil:
+ case f1: // ERROR "can only compare func f to nil"
+ default:
}
}