FIR: Refine makesSenseToBeDefinitelyNotNull
Make it work just the same as the analogue from FE 1.0 This change is necessary since many tests start failing after we began reporting diagnostics after call completion
This commit is contained in:
committed by
teamcityserver
parent
a700fdc312
commit
42d387925d
+4
-1
@@ -233,7 +233,10 @@ class ConeTypeSystemCommonBackendContextForTypeMapping(
|
||||
require(it is ConeKotlinType)
|
||||
}
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return defaultType().withArguments((arguments as List<ConeKotlinType>).toTypedArray())
|
||||
return defaultType().withArguments(
|
||||
(arguments as List<ConeKotlinType>).toTypedArray(),
|
||||
session.typeContext,
|
||||
)
|
||||
}
|
||||
|
||||
override fun TypeParameterMarker.representativeUpperBound(): ConeKotlinType {
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.fir.resolve.inference.inferenceComponents
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.AbstractConeSubstitutor
|
||||
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||
import org.jetbrains.kotlin.fir.typeContext
|
||||
import org.jetbrains.kotlin.name.StandardClassIds
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
@@ -24,6 +23,7 @@ import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
|
||||
import org.jetbrains.kotlin.ir.types.impl.IrStarProjectionImpl
|
||||
import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.StandardClassIds
|
||||
import org.jetbrains.kotlin.types.TypeApproximatorConfiguration
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
@@ -230,10 +230,7 @@ class Fir2IrTypeConverter(
|
||||
|
||||
private fun approximateType(type: ConeKotlinType): ConeKotlinType {
|
||||
if (type is ConeClassLikeType && type.typeArguments.isEmpty()) return type
|
||||
val substitutor = object : AbstractConeSubstitutor() {
|
||||
override val typeInferenceContext: ConeInferenceContext
|
||||
get() = session.inferenceComponents.ctx
|
||||
|
||||
val substitutor = object : AbstractConeSubstitutor(session.typeContext) {
|
||||
override fun substituteType(type: ConeKotlinType): ConeKotlinType? {
|
||||
return if (type is ConeIntersectionType) {
|
||||
type.alternativeType?.let { substituteOrSelf(it) }
|
||||
|
||||
+1
-4
@@ -664,10 +664,7 @@ class CallAndReferenceGenerator(
|
||||
return IrTypeOperatorCallImpl(this.startOffset, this.endOffset, samType, IrTypeOperator.SAM_CONVERSION, samType, this)
|
||||
}
|
||||
|
||||
private val starProjectionApproximator = object : AbstractConeSubstitutor() {
|
||||
override val typeInferenceContext: ConeInferenceContext
|
||||
get() = session.inferenceComponents.ctx
|
||||
|
||||
private val starProjectionApproximator = object : AbstractConeSubstitutor(session.typeContext) {
|
||||
override fun substituteType(type: ConeKotlinType): ConeKotlinType? {
|
||||
if (type !is ConeClassLikeType || type.typeArguments.none { it == ConeStarProjection }) return null
|
||||
val fir = type.lookupTag.toSymbol(session)?.fir as? FirTypeParameterRefsOwner ?: return null
|
||||
|
||||
Reference in New Issue
Block a user