From: Ian Lance Taylor Date: Thu, 29 Oct 2009 22:41:02 +0000 (-0700) Subject: Bug: 6g accepts fallthrough in type switch. X-Git-Tag: weekly.2009-11-06~179 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f305d0494361ebe581a3229c10fd0b328996afef;p=gostls13.git Bug: 6g accepts fallthrough in type switch. R=r CC=go-dev http://go/go-review/1016006 --- diff --git a/test/bugs/bug213.go b/test/bugs/bug213.go new file mode 100644 index 0000000000..07d9f9029d --- /dev/null +++ b/test/bugs/bug213.go @@ -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"); + } +} diff --git a/test/golden.out b/test/golden.out index 4d915e280d..8ace9fdfa0 100644 --- a/test/golden.out +++ b/test/golden.out @@ -204,3 +204,6 @@ panic PC=xxx =========== bugs/bug212.go BUG: errchk: command succeeded unexpectedly + +=========== bugs/bug213.go +BUG: errchk: command succeeded unexpectedly