[FIR2IR] Properly approximate intersection types during fir2ir conversion
^KT-62544 Fixed
This commit is contained in:
committed by
Space Team
parent
8c6da9fddb
commit
9366847e96
+1
-9
@@ -29,17 +29,9 @@ class TypeTranslatorImpl(
|
||||
|
||||
private val typeApproximatorForNI = TypeApproximator(moduleDescriptor.builtIns, languageVersionSettings)
|
||||
|
||||
private val typeApproximatorConfiguration =
|
||||
object : TypeApproximatorConfiguration.AllFlexibleSameValue() {
|
||||
override val allFlexible: Boolean get() = true
|
||||
override val errorType: Boolean get() = true
|
||||
override val integerLiteralConstantType: Boolean get() = true
|
||||
override val intersectionTypesInContravariantPositions: Boolean get() = true
|
||||
}
|
||||
|
||||
override fun approximateType(type: KotlinType): KotlinType =
|
||||
substituteAlternativesInPublicType(type).let {
|
||||
typeApproximatorForNI.approximateToSuperType(it, typeApproximatorConfiguration) ?: it
|
||||
typeApproximatorForNI.approximateToSuperType(it, TypeApproximatorConfiguration.FrontendToBackendTypesApproximation) ?: it
|
||||
}
|
||||
|
||||
override fun commonSupertype(types: Collection<KotlinType>): KotlinType =
|
||||
|
||||
Reference in New Issue
Block a user