]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: Set Signature.Recv for imported types
authorAndrew Wilkins <axwalk@gmail.com>
Mon, 7 Jan 2013 02:08:58 +0000 (18:08 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 7 Jan 2013 02:08:58 +0000 (18:08 -0800)
R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/7065046

src/pkg/go/types/gcimporter.go

index 38b94676bfcabfa9d9b98e4dc9ecfe154dd37f2b..96603b1a0ff8b662707008a482571e321360d253 100644 (file)
@@ -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 .