The existing code simply dropped them on the floor. Don't do that.
Fixes #23130.
Change-Id: I10f20e41f2c466a76519983253f87af7cf6d5e70
Reviewed-on: https://go-review.googlesource.com/83918
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
// receiver name. They will be type-checked later, with regular
// functions.
if list := d.Recv.List; len(list) > 0 {
- typ := list[0].Type
+ typ := unparen(list[0].Type)
if ptr, _ := typ.(*ast.StarExpr); ptr != nil {
- typ = ptr.X
+ typ = unparen(ptr.X)
}
if base, _ := typ.(*ast.Ident); base != nil && base.Name != "_" {
check.assocMethod(base.Name, obj)
func (x *(T7),) m4() {}
func (x (*(T7)),) m5() {}
func (x ((*((T7)))),) m6() {}
+
+// Check that methods with parenthesized receiver are actually present (issue #23130).
+var (
+ _ = T7.m1
+ _ = T7.m2
+ _ = (*T7).m3
+ _ = (*T7).m4
+ _ = (*T7).m5
+ _ = (*T7).m6
+)
\ No newline at end of file