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

Closed
griesemer opened this issue Apr 19, 2016 · 0 comments
Closed
Assignees
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Apr 19, 2016

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:
        fallthrough
        ;
    default:
    }
}

produces:

$ 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
@gopherbot gopherbot closed this in 082f464 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants