[FIR] Introduce & use FirTypeRef.coneType
This commit is contained in:
@@ -221,7 +221,7 @@ private fun FirTypeParameter.getErasedUpperBound(
|
||||
): ConeKotlinType {
|
||||
if (this === potentiallyRecursiveTypeParameter) return defaultValue()
|
||||
|
||||
val firstUpperBound = this.bounds.first().coneTypeUnsafe<ConeKotlinType>()
|
||||
val firstUpperBound = this.bounds.first().coneType
|
||||
|
||||
return getErasedVersionOfFirstUpperBound(firstUpperBound, mutableSetOf(this, potentiallyRecursiveTypeParameter), defaultValue)
|
||||
}
|
||||
@@ -256,7 +256,7 @@ private fun getErasedVersionOfFirstUpperBound(
|
||||
val current = firstUpperBound.lookupTag.typeParameterSymbol.fir
|
||||
|
||||
if (alreadyVisitedParameters.add(current)) {
|
||||
val nextUpperBound = current.bounds.first().coneTypeUnsafe<ConeKotlinType>()
|
||||
val nextUpperBound = current.bounds.first().coneType
|
||||
getErasedVersionOfFirstUpperBound(nextUpperBound, alreadyVisitedParameters, defaultValue)
|
||||
} else {
|
||||
defaultValue()
|
||||
|
||||
@@ -119,7 +119,7 @@ private fun coneFlexibleOrSimpleType(
|
||||
// TODO: we need enhancement for type parameter bounds for this code to work properly
|
||||
// At this moment, this condition is always true
|
||||
if (lookupTag.typeParameterSymbol.fir.bounds.any {
|
||||
val type = (it as FirResolvedTypeRef).type
|
||||
val type = it.coneType
|
||||
type is ConeTypeParameterType || type.isNullable
|
||||
}
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user