]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/go/types/signature.go
go/types, types2: introduce _Alias type node
[gostls13.git] / src / go / types / signature.go
index e34db602f3e6c95f72b2b9faf04e767b79460660..e7a348d8510ee713a7bf7ff77046dcb2d45a9ea1 100644 (file)
@@ -211,13 +211,14 @@ func (check *Checker) funcType(sig *Signature, recvPar *ast.FieldList, ftyp *ast
                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).