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/parser, cmd/gotype: misleading error message for type switch #11829

Closed
griesemer opened this issue Jul 22, 2015 · 1 comment
Closed

go/parser, cmd/gotype: misleading error message for type switch #11829

griesemer opened this issue Jul 22, 2015 · 1 comment

Comments

@griesemer
Copy link
Contributor

package main

func main() {
var x interface{}
switch _ := x.(type) {
case int:
}
switch _ = x.(type) {
case int:
}
}

produces:

x.go:8:12: expected switch expression, found simple statement (missing parentheses around composite literal?)

Investigate if this could be improved.

@griesemer griesemer self-assigned this Jul 22, 2015
@griesemer griesemer added this to the Unplanned milestone Jul 22, 2015
@griesemer
Copy link
Contributor Author

@golang golang locked and limited conversation to collaborators Sep 22, 2016
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

2 participants