mirror of
https://github.com/golang/go
synced 2024-11-21 23:54:40 -07:00
Bug: 6g accepts fallthrough in type switch.
R=r CC=go-dev http://go/go-review/1016006
This commit is contained in:
parent
449086eec9
commit
f305d04943
16
test/bugs/bug213.go
Normal file
16
test/bugs/bug213.go
Normal 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");
|
||||
}
|
||||
}
|
@ -204,3 +204,6 @@ panic PC=xxx
|
||||
|
||||
=========== bugs/bug212.go
|
||||
BUG: errchk: command succeeded unexpectedly
|
||||
|
||||
=========== bugs/bug213.go
|
||||
BUG: errchk: command succeeded unexpectedly
|
||||
|
Loading…
Reference in New Issue
Block a user