summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLorenzo Stoakes <lstoakes@gmail.com>2011-05-11 23:41:59 -0400
committerLorenzo Stoakes <lstoakes@gmail.com>2011-05-11 23:41:59 -0400
commit3e96eee01cb992ed4cbb338e2d6947d6e10bcfb6 (patch)
tree8d79942edf572664261858aa8d4dbe5cdbe6bc19 /test
parent37cd2ec3ac46635a87a4f1dae9c037ca3a42c3ef (diff)
downloadgo-3e96eee01cb992ed4cbb338e2d6947d6e10bcfb6.tar.gz
gc: fix type switch error message for invalid cases.
Fixes issue 1606. R=rsc CC=golang-dev http://codereview.appspot.com/4532045 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug340.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/fixedbugs/bug340.go b/test/fixedbugs/bug340.go
new file mode 100644
index 000000000..461cc6cd4
--- /dev/null
+++ b/test/fixedbugs/bug340.go
@@ -0,0 +1,17 @@
+// errchk $G $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.
+
+// Issue 1606.
+
+package main
+
+func main() {
+ var x interface{}
+ switch t := x.(type) { // ERROR "0 is not a type"
+ case 0:
+ t.x = 1 // ERROR "type interface \{ \}"
+ }
+}