1
0
mirror of https://github.com/golang/go synced 2024-11-25 12:57:58 -07:00

Bug: 6g accepts fallthrough in type switch.

R=r
CC=go-dev
http://go/go-review/1016006
This commit is contained in:
Ian Lance Taylor 2009-10-29 15:41:02 -07:00
parent 449086eec9
commit f305d04943
2 changed files with 19 additions and 0 deletions

16
test/bugs/bug213.go Normal file
View File

@ -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");
}
}

View File

@ -204,3 +204,6 @@ panic PC=xxx
=========== bugs/bug212.go =========== bugs/bug212.go
BUG: errchk: command succeeded unexpectedly BUG: errchk: command succeeded unexpectedly
=========== bugs/bug213.go
BUG: errchk: command succeeded unexpectedly