FIR: Implement lookup tracking

This commit is contained in:
Ilya Chernikov
2020-12-01 10:38:27 +01:00
parent 7d29ae7cce
commit f8d50d585d
41 changed files with 423 additions and 97 deletions
@@ -52,4 +52,8 @@ class FirCompositeScope(val scopes: Iterable<FirScope>) : FirScope(), FirContain
override fun getClassifierNames(): Set<Name> {
return scopes.flatMapTo(hashSetOf()) { it.getContainingClassifierNamesIfPresent() }
}
override val scopeOwnerLookupNames: List<String> by lazy(LazyThreadSafetyMode.PUBLICATION) {
scopes.flatMap { it.scopeOwnerLookupNames }
}
}
@@ -34,6 +34,8 @@ abstract class FirScope {
}
open fun mayContainName(name: Name) = true
open val scopeOwnerLookupNames: List<String> get() = emptyList()
}
fun FirScope.getSingleClassifier(name: Name): FirClassifierSymbol<*>? = mutableListOf<FirClassifierSymbol<*>>().apply {