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: error reporting for misplaced fallthrough could be better #15594

Closed
ALTree opened this issue May 7, 2016 · 1 comment
Closed

go/types: error reporting for misplaced fallthrough could be better #15594

ALTree opened this issue May 7, 2016 · 1 comment
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented May 7, 2016

On tip, on the following program:

package p
func g() {
    var x int
    switch x {
    case 1:
        fallthrough
    }
}

go/types reports a generic

test.go:7:3: fallthrough statement out of place

gc's error is more specific:

./test.go:7: cannot fallthrough final case in switch

@bradfitz bradfitz added this to the Go1.8 milestone May 7, 2016
@alandonovan alandonovan assigned griesemer and unassigned alandonovan May 9, 2016
@griesemer griesemer changed the title go/types: regression in error reporting for misplaced fallthrough go/types: error reporting for misplaced fallthrough could be better May 20, 2016
@griesemer
Copy link
Contributor

This is not a regression, it has always been like this for go/types. But agreed that the error message could be more specific.

@golang golang locked and limited conversation to collaborators Aug 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants