Skip to content

Commit

Permalink
printer: classfile static method
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Apr 9, 2024
1 parent 66309d4 commit eb6ed5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion printer/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,9 @@ func (p *printer) funcDecl(d *ast.FuncDecl) {
startCol := p.out.Column - len("func ")
if d.Recv != nil && !d.IsClass {
if d.Static { // static method
p.expr(d.Recv.List[0].Type)
if list := d.Recv.List; len(list) > 0 {
p.expr(list[0].Type)
}
p.print(token.PERIOD)
} else {
p.parameters(d.Recv) // method: print receiver
Expand Down

0 comments on commit eb6ed5b

Please sign in to comment.