Skip to content

Commit

Permalink
Merge pull request #267 from xushiwei/outline
Browse files Browse the repository at this point in the history
method gox.Func.Obj
  • Loading branch information
xushiwei authored Sep 30, 2023
2 parents e1d0dcd + 8bc24cf commit b66e83a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion func.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ type Func struct {
arity1 int // 0 for normal, (arity+1) for inlineClosure
}

// Obj returns this function object.
func (p *Func) Obj() types.Object {
return p
}

// Comments returns associated documentation.
func (p *Func) Comments() *ast.CommentGroup {
return p.decl.Doc
Expand Down Expand Up @@ -206,7 +211,7 @@ func (p *Package) NewFuncWith(
pos, "func init must have no arguments and no return values")
}
} else if name != "_" { // skip underscore
old := p.Types.Scope().Insert(fn)
old := p.Types.Scope().Insert(fn.Obj())
if old != nil {
oldPos := cb.position(old.Pos())
return nil, cb.newCodePosErrorf(
Expand Down

0 comments on commit b66e83a

Please sign in to comment.