[LL FIR] do not try to access supertypeRefs for classes during super types phase
We should try to find supe type refs in a session firstly, otherwise we can try to access by getResolvedSuperTypeRefsForOutOfSessionDeclaration ^KT-56550
This commit is contained in:
committed by
Space Team
parent
873c7d63ed
commit
46f987ba79
+3
-4
@@ -559,10 +559,9 @@ open class SupertypeComputationSession {
|
||||
|
||||
val supertypesSupplier: SupertypeSupplier = object : SupertypeSupplier() {
|
||||
override fun forClass(firClass: FirClass, useSiteSession: FirSession): List<ConeClassLikeType> {
|
||||
if (firClass.superTypeRefs.all { it is FirResolvedTypeRef }) return firClass.superConeTypes
|
||||
return (getSupertypesComputationStatus(firClass) as? SupertypeComputationStatus.Computed)?.supertypeRefs?.mapNotNull {
|
||||
it.coneTypeSafe<ConeClassLikeType>()
|
||||
}.orEmpty()
|
||||
val typeRefsFromSession = (getSupertypesComputationStatus(firClass) as? SupertypeComputationStatus.Computed)?.supertypeRefs
|
||||
val typeRefsToReturn = typeRefsFromSession ?: getResolvedSuperTypeRefsForOutOfSessionDeclaration(firClass)
|
||||
return typeRefsToReturn?.mapNotNull { it.coneTypeSafe<ConeClassLikeType>() }.orEmpty()
|
||||
}
|
||||
|
||||
override fun expansionForTypeAlias(typeAlias: FirTypeAlias, useSiteSession: FirSession): ConeClassLikeType? {
|
||||
|
||||
Reference in New Issue
Block a user