]> Cypherpunks repositories - gostls13.git/commitdiff
exp/types: set non-embedded method type during GcImport.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Thu, 2 Aug 2012 23:24:09 +0000 (16:24 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 2 Aug 2012 23:24:09 +0000 (16:24 -0700)
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/6445068

src/pkg/exp/types/gcimporter.go

index cbb3ce5d81d0f643e29f12e735a14274737d7131..8cae85a23bd61686fa6c37d6888a909bfdd14343 100644 (file)
@@ -510,11 +510,12 @@ func (p *gcParser) parseSignature() *Func {
 // MethodOrEmbedSpec = Name [ Signature ] .
 //
 func (p *gcParser) parseMethodOrEmbedSpec() *ast.Object {
-       p.parseName()
+       name := p.parseName()
        if p.tok == '(' {
-               p.parseSignature()
-               // TODO(gri) compute method object
-               return ast.NewObj(ast.Fun, "_")
+               typ := p.parseSignature()
+               obj := ast.NewObj(ast.Fun, name)
+               obj.Type = typ
+               return obj
        }
        // TODO lookup name and return that type
        return ast.NewObj(ast.Typ, "_")