checker: fix if

pull/5733/head
joe-conigliaro 2020-07-08 01:42:42 +10:00
parent 2480cce1ed
commit c99200918e
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1
1 changed files with 1 additions and 1 deletions

View File

@ -1025,7 +1025,7 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type {
found = true
}
// try prefix with current module as it would have never gotten prefixed
else if !fn_name.contains('.') && call_expr.mod !in ['builtin'] {
if !found && !fn_name.contains('.') && call_expr.mod !in ['builtin'] {
name_prefixed := '${call_expr.mod}.$fn_name'
if f1 := c.table.find_fn(name_prefixed) {
call_expr.name = name_prefixed