summaryrefslogtreecommitdiff
path: root/test/switch.go
diff options
context:
space:
mode:
authorTyler Bunnell <tylerbunnell@gmail.com>2013-03-15 00:35:09 -0400
committerTyler Bunnell <tylerbunnell@gmail.com>2013-03-15 00:35:09 -0400
commit0bdd66c8788fa6333e4ebcd8149e54aaeb7bb2ec (patch)
tree121bb845e7ee2c20e1a4f05f749f731342f9ccbc /test/switch.go
parent9590cd61275be3796f240a3aa3b788bcb138027d (diff)
downloadgo-0bdd66c8788fa6333e4ebcd8149e54aaeb7bb2ec.tar.gz
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://codereview.appspot.com/7841043 Committer: Russ Cox <rsc@golang.org>
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 bcbde68e4..5e1d85bb6 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: