parser: fix broken methods with vargs

pull/2614/head
Danil-Lapirow 2019-11-01 12:03:14 +02:00 committed by Alexander Medvednikov
parent bfe039fcba
commit 15f971ece7
1 changed files with 1 additions and 1 deletions

View File

@ -1260,7 +1260,7 @@ fn (p mut Parser) fn_call_vargs(f Fn) (string, []string) {
p.error_with_token_index('variadic arg index out of range: $va.index/${values.len-1}, vargs are 0 indexed', va.tok_idx) p.error_with_token_index('variadic arg index out of range: $va.index/${values.len-1}, vargs are 0 indexed', va.tok_idx)
} }
} }
if f.args.len > 1 { if !f.is_method && f.args.len > 1 {
p.cgen.gen(',') p.cgen.gen(',')
} }
return varg_def_type, values return varg_def_type, values