[FIR] Cleanup signature of getNestedClassifierScope

This commit is contained in:
Dmitriy Novozhilov
2020-08-21 12:01:42 +03:00
parent ffdc68b68d
commit d1f6e45b08
3 changed files with 7 additions and 7 deletions
@@ -61,7 +61,7 @@ abstract class FirAbstractTreeTransformerWithSuperTypes(
useSiteSession = session useSiteSession = session
).asReversed() ).asReversed()
for (superType in superTypes) { for (superType in superTypes) {
session.getNestedClassifierScope(superType.lookupTag, scopeSession)?.let { nestedClassifierScope -> superType.lookupTag.getNestedClassifierScope(session, scopeSession)?.let { nestedClassifierScope ->
val scope = nestedClassifierScope.wrapNestedClassifierScopeWithSubstitutionForSuperType(superType, session) val scope = nestedClassifierScope.wrapNestedClassifierScopeWithSubstitutionForSuperType(superType, session)
scopes.add(scope) scopes.add(scope)
} }
@@ -150,7 +150,7 @@ private fun createScopesForNestedClasses(
lookupInterfaces = false, deep = true, substituteTypes = true, useSiteSession = session, lookupInterfaces = false, deep = true, substituteTypes = true, useSiteSession = session,
supertypeSupplier = supertypeComputationSession.supertypesSupplier supertypeSupplier = supertypeComputationSession.supertypesSupplier
).asReversed().mapNotNullTo(this) { ).asReversed().mapNotNullTo(this) {
session.getNestedClassifierScope(it.lookupTag, scopeSession) it.lookupTag.getNestedClassifierScope(session, scopeSession)
?.wrapNestedClassifierScopeWithSubstitutionForSuperType(it, session) ?.wrapNestedClassifierScopeWithSubstitutionForSuperType(it, session)
} }
addIfNotNull(klass.typeParametersScope()) addIfNotNull(klass.typeParametersScope())
@@ -66,10 +66,10 @@ private fun doCreateImportingScopes(
private val PACKAGE_MEMBER = scopeSessionKey<FqName, FirPackageMemberScope>() private val PACKAGE_MEMBER = scopeSessionKey<FqName, FirPackageMemberScope>()
fun FirSession.getNestedClassifierScope(lookupTag: ConeClassLikeLookupTag, scopeSession: ScopeSession): FirScope? { fun ConeClassLikeLookupTag.getNestedClassifierScope(session: FirSession, scopeSession: ScopeSession): FirScope? {
val klass = when (lookupTag) { val klass = when (this) {
is ConeClassLookupTagWithFixedSymbol -> lookupTag.symbol.fir is ConeClassLookupTagWithFixedSymbol -> symbol.fir
else -> firSymbolProvider.getClassLikeSymbolByFqName(lookupTag.classId)?.fir as? FirRegularClass ?: return null else -> session.firSymbolProvider.getClassLikeSymbolByFqName(classId)?.fir as? FirRegularClass ?: return null
} }
return klass.scopeProvider.getNestedClassifierScope(klass, this, scopeSession) return klass.scopeProvider.getNestedClassifierScope(klass, session, scopeSession)
} }