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

fix V.js methods after the recent generics fix

This commit is contained in:
Alexander Medvednikov
2019-10-25 21:57:32 +03:00
parent 280c7d396c
commit 9c5a359de3
4 changed files with 17 additions and 8 deletions

View File

@ -721,14 +721,13 @@ fn (p mut Parser) fn_call(f mut Fn, method_ph int, receiver_var, receiver_type s
if !p.expr_var.is_changed {
p.mark_var_changed(p.expr_var)
}
met_call := p.gen_method_call(receiver, receiver_type, cgen_name, f.typ)
p.cgen.set_placeholder(method_ph, met_call)
p.gen_method_call(receiver, receiver_type, cgen_name, f.typ, method_ph)
} else {
// Normal function call
p.gen('$cgen_name (')
}
// foo<Bar>()
// `foo<Bar>()`
// if f is generic, the name is changed to a suitable instance in dispatch_generic_fn_instance()
// we then replace `cgen_name` with the instance's name
generic := f.is_generic