[minor] break loops if it is ambiguous (#18745)
* [minor] break loops if it is ambiguous * Update compiler/lookups.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
parent
041edaa1df
commit
5eba372570
1 changed files with 7 additions and 6 deletions
|
|
@ -181,13 +181,14 @@ proc someSymFromImportTable*(c: PContext; name: PIdent; ambiguous: var bool): PS
|
|||
if overloadableEnums notin c.features:
|
||||
symSet.excl skEnumField
|
||||
result = nil
|
||||
for im in c.imports.mitems:
|
||||
for s in symbols(im, marked, name, c.graph):
|
||||
if result == nil:
|
||||
result = s
|
||||
else:
|
||||
if s.kind notin symSet or result.kind notin symSet:
|
||||
block outer:
|
||||
for im in c.imports.mitems:
|
||||
for s in symbols(im, marked, name, c.graph):
|
||||
if result == nil:
|
||||
result = s
|
||||
elif s.kind notin symSet or result.kind notin symSet:
|
||||
ambiguous = true
|
||||
break outer
|
||||
|
||||
proc searchInScopes*(c: PContext, s: PIdent; ambiguous: var bool): PSym =
|
||||
for scope in allScopes(c.currentScope):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue