// expected: method T.M already declared // // A method declared twice is a redeclaration, the same error go/types reports. // The top-level check landed first and covered functions only: stage4 compiled // the second body away and answered 1 where legacy refuses the package. package main type T struct{ n int32 } func (t *T) M() (r int32) { return 1 } func (t *T) M() (r int32) { return 2 } func main() { x := &T{} println(x.M()) }