Fixed name resolution error in findByName

This commit is contained in:
Mattia Giambirtone 2022-08-14 19:51:12 +02:00
parent c85fff8f67
commit 39a84182b0
1 changed files with 2 additions and 0 deletions

View File

@ -714,6 +714,8 @@ proc findByName(self: Compiler, name: string): seq[Name] =
## with the given name. Returns all objects that apply
for obj in reversed(self.names):
if obj.name.token.lexeme == name:
if obj.isPrivate and obj.owner != self.currentModule:
continue
result.add(obj)