Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/types: valid fallthrough position must accept trailing empty statements #15376

griesemer opened this issue Apr 19, 2016 · 0 comments


Copy link

Per the spec:

A "fallthrough" statement transfers control to the first statement of the next case clause in an expression "switch" statement. It may be used only as the final non-empty statement in such a clause.

go/types doesn't currently permit trailing empty statements:

$ cat x.go
package p

func x(x int) {
    switch x {
    case 0:


$ gotype x.go
x.go:6:3: fallthrough statement out of place
@griesemer griesemer self-assigned this Apr 19, 2016
@griesemer griesemer added this to the Go1.7 milestone Apr 19, 2016
@golang golang locked and limited conversation to collaborators Apr 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

2 participants