Add necessary ResolutionScope::recordLookup implementations
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user