go/types: allows duplicate switch cases
dvyukov opened this issue · 3 comments
dvyukov commented
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 commented
Note that the spec doesn't specify that this is prohibited (but it should). See also #4524.
gopherbot commented
CL https://golang.org/cl/13285 mentions this issue.