diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt index 76f82239400..a8b6598eeaa 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt @@ -437,6 +437,9 @@ class NewConstraintSystemImpl( override fun hasUpperOrEqualUnitConstraint(type: KotlinTypeMarker): Boolean { checkState(State.BUILDING, State.COMPLETION, State.FREEZED) val constraints = storage.notFixedTypeVariables[type.typeConstructor()]?.constraints ?: return false - return constraints.any { (it.kind == ConstraintKind.UPPER || it.kind == ConstraintKind.EQUALITY) && it.type.isUnit() } + return constraints.any { + (it.kind == ConstraintKind.UPPER || it.kind == ConstraintKind.EQUALITY) && + it.type.lowerBoundIfFlexible().isUnit() + } } }