[FE] Fix 'containingClassForStaticMemberAttr' for fake overrides (KTIJ-22808)
This commit is contained in:
@@ -93,7 +93,7 @@ object JavaScopeProvider : FirScopeProvider() {
|
||||
)
|
||||
|
||||
val superTypeScopes = superTypes.mapNotNull {
|
||||
it.scopeForSupertype(useSiteSession, scopeSession, subClass = regularClass)
|
||||
it.scopeForSupertype(useSiteSession, scopeSession, regularClass)
|
||||
}
|
||||
|
||||
JavaClassUseSiteMemberScope(
|
||||
|
||||
@@ -81,6 +81,7 @@ private fun wrapSubstitutionScopeIfNeed(
|
||||
session, useSiteMemberScope, PLATFORM_TYPE_PARAMETERS_SUBSTITUTION_SCOPE_KEY, substitutor,
|
||||
dispatchReceiverTypeForSubstitutedMembers = derivedClass.defaultType(),
|
||||
skipPrivateMembers = true,
|
||||
derivedClassLookupTag = derivedClass.symbol.toLookupTag()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.fir.scopes.jvm
|
||||
|
||||
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsSignatures
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.containingClassForStaticMemberAttr
|
||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.classId
|
||||
@@ -81,6 +80,7 @@ class JvmMappedScope(
|
||||
FirFakeOverrideGenerator.createCopyForFirFunction(
|
||||
newSymbol,
|
||||
baseFunction = symbol.fir,
|
||||
derivedClassLookupTag = firKotlinClass.symbol.toLookupTag(),
|
||||
session,
|
||||
symbol.fir.origin,
|
||||
newDispatchReceiverType = kotlinDispatchReceiverType,
|
||||
@@ -125,6 +125,7 @@ class JvmMappedScope(
|
||||
newSymbol,
|
||||
session,
|
||||
oldConstructor,
|
||||
derivedClassLookupTag = firKotlinClass.symbol.toLookupTag(),
|
||||
symbol.fir.origin,
|
||||
newDispatchReceiverType = null,
|
||||
newReturnType = substitutor.substituteOrSelf(oldConstructor.returnTypeRef.coneType),
|
||||
@@ -133,9 +134,7 @@ class JvmMappedScope(
|
||||
newContextReceiverTypes = emptyList(),
|
||||
isExpect = false,
|
||||
fakeOverrideSubstitution = null
|
||||
).apply {
|
||||
containingClassForStaticMemberAttr = firKotlinClass.symbol.toLookupTag()
|
||||
}
|
||||
)
|
||||
newSymbol
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user