[FIR] Add substitution for inner classes to supertype resolve
KT-38992 Fixed
This commit is contained in:
+3
-1
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.scopes.createImportingScopes
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirMemberTypeParameterScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.nestedClassifierScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.wrapNestedClassifierScopeWithSubstitutionForSuperType
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef
|
||||
@@ -145,10 +146,11 @@ private fun createScopesForNestedClasses(
|
||||
mutableListOf<FirScope>().apply {
|
||||
lookupSuperTypes(
|
||||
klass,
|
||||
lookupInterfaces = false, deep = true, useSiteSession = session,
|
||||
lookupInterfaces = false, deep = true, substituteTypes = true, useSiteSession = session,
|
||||
supertypeSupplier = supertypeComputationSession.supertypesSupplier
|
||||
).asReversed().mapNotNullTo(this) {
|
||||
session.getNestedClassifierScope(it.lookupTag)
|
||||
?.wrapNestedClassifierScopeWithSubstitutionForSuperType(it, session)
|
||||
}
|
||||
addIfNotNull(klass.typeParametersScope())
|
||||
val companionObjects = klass.declarations.filterIsInstance<FirRegularClass>().filter { it.isCompanion }
|
||||
|
||||
Reference in New Issue
Block a user