aboutsummaryrefslogtreecommitdiff
path: root/test/typeswitch3.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-02-06 12:35:29 -0500
committerRuss Cox <rsc@golang.org>2012-02-06 12:35:29 -0500
commit74ee51ee92d35ccc6486b9126265bd2c62be2c3f (patch)
treee6ae64b5e543989a3cc2a505ae456d530a12581e /test/typeswitch3.go
parent98257750f483238f2895d6077bf42e7c91cd8f3d (diff)
downloadgo-74ee51ee92d35ccc6486b9126265bd2c62be2c3f.tar.gz
go-74ee51ee92d35ccc6486b9126265bd2c62be2c3f.zip
cmd/gc: disallow switch _ := v.(type)
Fixes #2827. R=ken2 CC=golang-dev https://golang.org/cl/5638045
Diffstat (limited to 'test/typeswitch3.go')
-rw-r--r--test/typeswitch3.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/typeswitch3.go b/test/typeswitch3.go
index 078980146f..e11da7d747 100644
--- a/test/typeswitch3.go
+++ b/test/typeswitch3.go
@@ -30,6 +30,10 @@ func main(){
switch r.(type) {
case io.Writer:
}
+
+ // Issue 2827.
+ switch _ := r.(type) { // ERROR "invalid variable name _"
+ }
}