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

Comments

@dvyukov
Copy link
Member

@dvyukov 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

@griesemer griesemer commented Jul 3, 2015

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

Loading

@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

@griesemer griesemer commented Aug 7, 2015

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 21, 2015

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

Loading

@griesemer griesemer closed this in b1b3243 Aug 26, 2015
@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants