[FIR] Make session part of the key of declared scope cache

In the following commits, there will be a need to retrieve the scope of
  the same class from different sessions, so we need to consider the
  session as part of the key along with class symbol
This commit is contained in:
Dmitriy Novozhilov
2024-01-08 14:43:15 +02:00
committed by Nikolay Lunyak
parent 77547c0312
commit ff063f553e
2 changed files with 2 additions and 2 deletions
@@ -175,7 +175,7 @@ inline fun <reified ID : Any, reified FS : FirScope> scopeSessionKey(): ScopeSes
return object : ScopeSessionKey<ID, FS>() {}
}
val USE_SITE = scopeSessionKey<FirClassSymbol<*>, FirTypeScope>()
val USE_SITE = scopeSessionKey<Pair<FirSession, FirClassSymbol<*>>, FirTypeScope>()
/* TODO REMOVE */
fun createSubstitutionForScope(
@@ -46,7 +46,7 @@ class FirKotlinScopeProvider(
klass.lazyResolveToPhaseWithCallableMembers(it)
}
return scopeSession.getOrBuild(klass.symbol, USE_SITE) {
return scopeSession.getOrBuild(useSiteSession to klass.symbol, USE_SITE) {
val declaredScope = useSiteSession.declaredMemberScope(klass, memberRequiredPhase)
val possiblyDelegatedDeclaredMemberScope = declaredMemberScopeDecorator(
klass,