Skip to content

Commit

Permalink
https://github.com/goplus/gop/issues/757
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Aug 31, 2021
1 parent baae9e8 commit 6174703
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -1435,12 +1435,12 @@ func (p *CodeBuilder) Member(name string, lhs bool, src ...ast.Node) (kind Membe
if isTypeType && kind == MemberMethod {
e := p.Get(-1)
if sig, ok := e.Type.(*types.Signature); ok {
var vars []*types.Var
vars = append(vars, types.NewVar(token.NoPos, nil, "recv", at))
sp := sig.Params()
spLen := sp.Len()
vars := make([]*types.Var, spLen+1)
vars[0] = types.NewVar(token.NoPos, nil, "", at)
for i := 0; i < spLen; i++ {
vars = append(vars, sp.At(i))
vars[i+1] = sp.At(i)
}
e.Type = types.NewSignature(nil, types.NewTuple(vars...), sig.Results(), sig.Variadic())
}
Expand Down

0 comments on commit 6174703

Please sign in to comment.