diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt index 03dd23eca17..f0801e08408 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt @@ -82,6 +82,7 @@ private fun ConstraintSystemBuilderImpl.addConstraintFromBounds(old: Bound, new: } private fun ConstraintSystemBuilderImpl.generateNewBound(bound: Bound, substitution: Bound) { + if (bound === substitution) return // Let's have a bound 'T <=> My', and a substitution 'R <=> Type'. // Here <=> means lower_bound, upper_bound or exact_bound constraint. // Then a new bound 'T <=> My<_/in/out Type>' can be generated. @@ -127,4 +128,4 @@ private fun ConstraintSystemBuilderImpl.generateNewBound(bound: Bound, substitut if (approximationBounds.lower.containsConstrainingTypeWithoutProjection() && bound.kind != UPPER_BOUND) { addNewBound(approximationBounds.lower, LOWER_BOUND) } -} \ No newline at end of file +}