Add necessary ResolutionScope::recordLookup implementations

This commit is contained in:
Denis Zharkov
2017-08-24 11:14:15 +03:00
parent 580a7e3e4d
commit 265794e712
5 changed files with 28 additions and 1 deletions
@@ -86,6 +86,10 @@ class AllUnderImportScope(
return scopes.flatMap { it.getContributedFunctions(name, location) }
}
override fun recordLookup(name: Name, location: LookupLocation) {
scopes.forEach { it.recordLookup(name, location) }
}
override fun printStructure(p: Printer) {
p.println(this::class.java.simpleName)
}
@@ -198,6 +198,13 @@ class LazyImportResolver(
}
fun definitelyDoesNotContainName(name: Name) = allNames?.let { name !in it } == true
fun recordLookup(name: Name, location: LookupLocation) {
if (allNames == null) return
indexedImports.importsForName(name).forEach {
getImportScope(it).recordLookup(name, location)
}
}
}
class LazyImportScope(
@@ -278,5 +285,10 @@ class LazyImportScope(
}
override fun definitelyDoesNotContainName(name: Name) = importResolver.definitelyDoesNotContainName(name)
override fun recordLookup(name: Name, location: LookupLocation) {
importResolver.recordLookup(name, location)
}
override fun computeImportedNames() = importResolver.allNames
}