]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/types2/signature.go
go/types, types2: introduce _Alias type node
[gostls13.git] / src / cmd / compile / internal / types2 / signature.go
index edd8d66f13702026c806eafa65eca23f0b14bfab..f876b16c8f6b4c47a3c0195b0a80d32c7e5084c3 100644 (file)
@@ -208,13 +208,14 @@ func (check *Checker) funcType(sig *Signature, recvPar *syntax.Field, tparams []
                check.later(func() {
                        // spec: "The receiver type must be of the form T or *T where T is a type name."
                        rtyp, _ := deref(recv.typ)
-                       if !isValid(rtyp) {
+                       atyp := _Unalias(rtyp)
+                       if !isValid(atyp) {
                                return // error was reported before
                        }
                        // spec: "The type denoted by T is called the receiver base type; it must not
                        // be a pointer or interface type and it must be declared in the same package
                        // as the method."
-                       switch T := rtyp.(type) {
+                       switch T := atyp.(type) {
                        case *Named:
                                // The receiver type may be an instantiated type referred to
                                // by an alias (which cannot have receiver parameters for now).