mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: fixes issue #3074 - can't call a generic function twice with the same data type
This commit is contained in:
parent
29fc3fc82f
commit
cb9e9286ef
@ -1469,6 +1469,7 @@ fn (p mut Parser) dispatch_generic_fn_instance(f mut Fn, ti &TypeInst) {
|
|||||||
}
|
}
|
||||||
if !new_inst {
|
if !new_inst {
|
||||||
rename_generic_fn_instance(mut f, ti)
|
rename_generic_fn_instance(mut f, ti)
|
||||||
|
replace_generic_type_params(mut f, ti)
|
||||||
_ = p.table.find_fn(f.name) or {
|
_ = p.table.find_fn(f.name) or {
|
||||||
p.error('function instance `$f.name` not found')
|
p.error('function instance `$f.name` not found')
|
||||||
return
|
return
|
||||||
@ -1480,7 +1481,6 @@ fn (p mut Parser) dispatch_generic_fn_instance(f mut Fn, ti &TypeInst) {
|
|||||||
p.table.register_fn(f)
|
p.table.register_fn(f)
|
||||||
rename_generic_fn_instance(mut f, ti)
|
rename_generic_fn_instance(mut f, ti)
|
||||||
replace_generic_type_params(mut f, ti)
|
replace_generic_type_params(mut f, ti)
|
||||||
// TODO: save dispatch info when update to incremental parsing
|
|
||||||
f.dispatch_of = *ti
|
f.dispatch_of = *ti
|
||||||
// TODO: Handle case where type not defined yet, see above
|
// TODO: Handle case where type not defined yet, see above
|
||||||
// if f.typ in f.type_pars { f.typ = '_ANYTYPE_' }
|
// if f.typ in f.type_pars { f.typ = '_ANYTYPE_' }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user