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: allows duplicate switch cases #11578

Closed
dvyukov opened this issue Jul 3, 2015 · 3 comments
Closed

go/types: allows duplicate switch cases #11578

dvyukov opened this issue Jul 3, 2015 · 3 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 3, 2015

go/types accepts the following program:

package a
func f() {
    switch 0 {
        case 0:
        case 0:
    }
}

While both gc and gccgo reject it with duplicate case 0 in switch.
Compilers should agree on validity of this program.

on commit 997b354

@griesemer griesemer added this to the Go1.6 milestone Jul 3, 2015
@griesemer
Copy link
Contributor

Note that the spec doesn't specify that this is prohibited (but it should). See also #4524.

@ianlancetaylor ianlancetaylor changed the title x/tools/go/types: allows duplicate switch cases go/types: allows duplicate switch cases Jul 10, 2015
@griesemer
Copy link
Contributor

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/13285 mentions this issue.

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

3 participants