Skip to content

Commit

Permalink
#648: fix invalid code generation when interface method parameter's n…
Browse files Browse the repository at this point in the history
…ame is the same as interface name
  • Loading branch information
kozmod committed Jun 25, 2023
1 parent ec88c00 commit 2a69b15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ func (g *Generator) genList(ctx context.Context, list *types.Tuple, variadic boo
}

pname := v.Name()
if ts == pname {
pname = fmt.Sprintf("%s%d", pname, i)
}

if g.nameCollides(pname) || pname == "" {
pname = fmt.Sprintf("_a%d", i)
Expand Down

0 comments on commit 2a69b15

Please sign in to comment.