package p
func f(e interface{}) {
switch e := e.(type) {
case T:
e.M()
}
}
$ go tool compile x.go
x.go:5:7: undefined: T
x.go:6:4: e.M undefined (type interface {} is interface with no methods)
The first error message is accurate and helpful. We should suppress the second error message, which is confusing.
The first error message is accurate and helpful. We should suppress the second error message, which is confusing.