From 02370f6760ca41a9a2061a1398e6a7af64bf541a Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Sun, 6 Jan 2013 18:08:58 -0800 Subject: [PATCH] go/types: Set Signature.Recv for imported types R=golang-dev, bradfitz, gri CC=golang-dev https://golang.org/cl/7065046 --- src/pkg/go/types/gcimporter.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pkg/go/types/gcimporter.go b/src/pkg/go/types/gcimporter.go index 38b94676bf..96603b1a0f 100644 --- a/src/pkg/go/types/gcimporter.go +++ b/src/pkg/go/types/gcimporter.go @@ -766,9 +766,10 @@ func (p *gcParser) parseVarDecl() { // Func = Signature [ Body ] . // Body = "{" ... "}" . // -func (p *gcParser) parseFunc(scope *ast.Scope, name string) { +func (p *gcParser) parseFunc(scope *ast.Scope, name string) *Signature { obj := p.declare(scope, ast.Fun, name) - obj.Type = p.parseSignature() + sig := p.parseSignature() + obj.Type = sig if p.tok == '{' { p.next() for i := 1; i > 0; p.next() { @@ -780,6 +781,7 @@ func (p *gcParser) parseFunc(scope *ast.Scope, name string) { } } } + return sig } // MethodDecl = "func" Receiver Name Func . @@ -809,7 +811,8 @@ func (p *gcParser) parseMethodDecl() { // declare method in base type scope name := p.parseName() // unexported method names in imports are qualified with their package. - p.parseFunc(scope, name) + sig := p.parseFunc(scope, name) + sig.Recv = recv } // FuncDecl = "func" ExportedName Func . -- 2.48.1