]> Cypherpunks repositories - gostls13.git/commitdiff
Bug: 6g accepts fallthrough in type switch.
authorIan Lance Taylor <iant@golang.org>
Thu, 29 Oct 2009 22:41:02 +0000 (15:41 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 29 Oct 2009 22:41:02 +0000 (15:41 -0700)
R=r
CC=go-dev
http://go/go-review/1016006

test/bugs/bug213.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug213.go b/test/bugs/bug213.go
new file mode 100644 (file)
index 0000000..07d9f90
--- /dev/null
@@ -0,0 +1,16 @@
+// errchk $G $D/$F.go
+
+// Copyright 2009 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() {
+       var v interface{} = 0;
+       switch x := v.(type) {
+       case int:
+               fallthrough;            // ERROR "fallthrough"
+       default:
+               panic("fell through");
+       }
+}
index 4d915e280dceab9ab3c835fa0178533fa724701f..8ace9fdfa0ac365dbba8eee0d1e945fdb9b5fb0d 100644 (file)
@@ -204,3 +204,6 @@ panic PC=xxx
 
 =========== bugs/bug212.go
 BUG: errchk: command succeeded unexpectedly
+
+=========== bugs/bug213.go
+BUG: errchk: command succeeded unexpectedly