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

compiler: fix #3973 by dealing with name mangling problem

This commit is contained in:
hazohelet
2020-03-26 16:54:33 +09:00
committed by GitHub
parent d54843275f
commit d8bcd13e86
5 changed files with 76 additions and 66 deletions

View File

@ -384,6 +384,16 @@ fn (t &Table) known_fn(name string) bool {
return true
}
fn (p &Parser) known_fn_in_mod(name string) bool {
existing_fn := p.table.find_fn(name) or {
return false
}
if (existing_fn.mod == p.mod || existing_fn.mod == 'builtin') {
return true
}
return false
}
fn (t &Table) known_const(name string) bool {
_ = t.find_const(name) or {
return false