aboutsummaryrefslogtreecommitdiff
path: root/test/syntax
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-02-01 14:00:36 -0500
committerRuss Cox <rsc@golang.org>2011-02-01 14:00:36 -0500
commit05b9050bda586eff8be1cc7c262dd57d0a009175 (patch)
tree7fa33f0ab96d2777a77cc1b9e8d19fabcaddb4a3 /test/syntax
parent865d5767022326e097482ec211ab24b9418afda7 (diff)
downloadgo-05b9050bda586eff8be1cc7c262dd57d0a009175.tar.gz
go-05b9050bda586eff8be1cc7c262dd57d0a009175.zip
gc: handle invalid name in type switch
Fixes #1453. R=ken2 CC=golang-dev https://golang.org/cl/4125043
Diffstat (limited to 'test/syntax')
-rw-r--r--test/syntax/typesw.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/syntax/typesw.go b/test/syntax/typesw.go
new file mode 100644
index 0000000000..47f683cdf2
--- /dev/null
+++ b/test/syntax/typesw.go
@@ -0,0 +1,13 @@
+// errchk $G -e $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func main() {
+ switch main() := interface{}(nil).(type) { // ERROR "invalid variable name"
+ default:
+ }
+}