1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix broken methods with vargs

This commit is contained in:
Danil-Lapirow 2019-11-01 12:03:14 +02:00 committed by Alexander Medvednikov
parent bfe039fcba
commit 15f971ece7

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