[FIR] Drop ImplicitReceiverValue.expandedType
This field cached expansion of type of implicit receiver, which is incorrect, because type of receiver may change because of smartcasts, but this field was immutable
This commit is contained in:
committed by
Space Team
parent
c55ddab1bf
commit
b564260a33
@@ -97,7 +97,7 @@ open class ExpressionReceiverValue(
|
||||
sealed class ImplicitReceiverValue<S : FirBasedSymbol<*>>(
|
||||
val boundSymbol: S,
|
||||
type: ConeKotlinType,
|
||||
protected val useSiteSession: FirSession,
|
||||
val useSiteSession: FirSession,
|
||||
protected val scopeSession: ScopeSession,
|
||||
private val mutable: Boolean,
|
||||
val contextReceiverNumber: Int = -1,
|
||||
@@ -110,8 +110,6 @@ sealed class ImplicitReceiverValue<S : FirBasedSymbol<*>>(
|
||||
|
||||
val originalType: ConeKotlinType = type
|
||||
|
||||
val expandedType: ConeKotlinType = type.applyIf(type is ConeClassLikeType) { fullyExpandedType(useSiteSession) }
|
||||
|
||||
var implicitScope: FirTypeScope? =
|
||||
type.scope(
|
||||
useSiteSession,
|
||||
|
||||
+1
-1
@@ -276,7 +276,7 @@ class FirTowerDataElement(
|
||||
}
|
||||
|
||||
private fun ImplicitReceiverValue<*>.getImplicitScope(): FirScope {
|
||||
return when (expandedType) {
|
||||
return when (type.fullyExpandedType(useSiteSession)) {
|
||||
is ConeErrorType,
|
||||
is ConeStubType -> FirTypeScope.Empty
|
||||
else -> implicitScope ?: error("Scope for type ${type::class.simpleName} is null.")
|
||||
|
||||
Reference in New Issue
Block a user