diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/MutableConstraintStorage.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/MutableConstraintStorage.kt index dc1a3ddc705..7ea2c276686 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/MutableConstraintStorage.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/MutableConstraintStorage.kt @@ -73,7 +73,8 @@ class MutableVariableWithConstraints private constructor( Constraint( ConstraintKind.EQUALITY, constraint.type, - constraint.position, + constraint.position.takeIf { it.from !is DeclaredUpperBoundConstraintPosition<*> } + ?: previousConstraint.position, constraint.typeHashCode, derivedFrom = constraint.derivedFrom, isNullabilityConstraint = false