aboutsummaryrefslogtreecommitdiff
path: root/test/switch.go
diff options
context:
space:
mode:
authorTyler Bunnell <tylerbunnell@gmail.com>2013-03-15 00:35:09 -0400
committerRuss Cox <rsc@golang.org>2013-03-15 00:35:09 -0400
commitf6a952599e2e9d75b50d1b1252397325111b1a87 (patch)
tree4e52cd38038c383664764478986cc65238c787ba /test/switch.go
parentd94da6fab584ebba9fd9b9adcecc173a4174932f (diff)
downloadgo-f6a952599e2e9d75b50d1b1252397325111b1a87.tar.gz
go-f6a952599e2e9d75b50d1b1252397325111b1a87.zip
cmd/gc: disallow fallthrough in final case of switch
Small change to cmd/gc to catch a "fallthrough" in the final case of a switch. R=golang-dev, rsc, mtj CC=golang-dev https://golang.org/cl/7841043
Diffstat (limited to 'test/switch.go')
-rw-r--r--test/switch.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/test/switch.go b/test/switch.go
index bcbde68e46..5e1d85bb68 100644
--- a/test/switch.go
+++ b/test/switch.go
@@ -392,15 +392,6 @@ func main() {
}
assert(count == 2, "fail")
- // fallthrough in final case.
- count = 0
- switch i5 {
- case 5:
- count++
- fallthrough
- }
- assert(count == 1, "fail")
-
i := 0
switch x := 5; {
case i < x: