[FIR] Support determining emptiness of an intersection type with type parameters' types
This commit is contained in:
committed by
teamcity
parent
313da6f41e
commit
47d6236a2d
+3
-5
@@ -26,9 +26,7 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValueWithSmartCastI
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.parentsWithSelf
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.error.ErrorUtils
|
||||
import org.jetbrains.kotlin.types.model.KotlinTypeMarker
|
||||
import org.jetbrains.kotlin.types.model.TypeConstructorMarker
|
||||
import org.jetbrains.kotlin.types.model.typeConstructor
|
||||
import org.jetbrains.kotlin.types.model.*
|
||||
import org.jetbrains.kotlin.types.typeUtil.*
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.cast
|
||||
@@ -903,12 +901,12 @@ internal object CheckContextReceiversResolutionPart : ResolutionPart() {
|
||||
|
||||
internal object CheckIncompatibleTypeVariableUpperBounds : ResolutionPart() {
|
||||
override fun ResolutionCandidate.process(workIndex: Int) = with(getSystem().asConstraintSystemCompleterContext()) {
|
||||
val typeVariables = getSystem().getBuilder().currentStorage().notFixedTypeVariables.values
|
||||
val typeVariables = getSystem().getBuilder().currentStorage().notFixedTypeVariables.values.takeIf { it.isNotEmpty() } ?: return
|
||||
|
||||
for (variableWithConstraints in typeVariables) {
|
||||
val upperTypes = variableWithConstraints.constraints.extractUpperTypes()
|
||||
|
||||
if (upperTypes.isEmptyIntersection()) {
|
||||
if (upperTypes.computeEmptyIntersectionTypeKind().isDefinitelyEmpty()) {
|
||||
val isInferredEmptyIntersectionForbidden =
|
||||
callComponents.languageVersionSettings.supportsFeature(LanguageFeature.ForbidInferringTypeVariablesIntoEmptyIntersection)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user