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
Assignees
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Jul 22, 2015

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

@griesemer griesemer commented Sep 17, 2015

@griesemer griesemer closed this Sep 17, 2015
@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.