You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package p
type A int
const X A = 0
func f() {
type A int
const Y A = 0
switch interface{}(nil) {
case X:
case Y:
}
}
go/types and gccgo accept it, but cmd/compile erroneously rejects it with:
a.go:12:2: duplicate case Y (value 0) in switch
previous case at a.go:4:13
The issue is swt.go:632 is using typeVal to look for value collisions. However, it's using the string representation of types to look for type identity, but this isn't sound as the example above demonstrates.
The text was updated successfully, but these errors were encountered:
This code is spec compliant:
go/types and gccgo accept it, but cmd/compile erroneously rejects it with:
The issue is swt.go:632 is using typeVal to look for value collisions. However, it's using the string representation of types to look for type identity, but this isn't sound as the example above demonstrates.
The text was updated successfully, but these errors were encountered: