Do not resolve import to get imported name

This commit is contained in:
Alexander Podkhalyuzin
2019-05-31 11:41:03 +02:00
committed by Vladimir Dolzhenko
parent 9d02fe564c
commit 60c3e6442f
@@ -115,10 +115,18 @@ open class LazyImportResolver<I : KtImportInfo>(
}
val allNames: Set<Name>? by lazy(LazyThreadSafetyMode.PUBLICATION) {
indexedImports.imports.flatMapToNullable(THashSet()) { getImportScope(it).computeImportedNames() }
indexedImports.imports.flatMapToNullable(THashSet()) {
if (it.isAllUnder) getImportScope(it).computeImportedNames()
else listOf(it.importedName)
}
}
fun definitelyDoesNotContainName(name: Name) = allNames?.let { name !in it } == true
fun definitelyDoesNotContainName(name: Name): Boolean {
return indexedImports.imports.find {
if (it.isAllUnder) getImportScope(it).definitelyDoesNotContainName(name) //todo: optimize...
else it.importedName == name
} != null
}
fun recordLookup(name: Name, location: LookupLocation) {
if (allNames == null) return