diff --git a/compiler/testData/constraintSystem/severalVariables/recursive/simpleRecursive.bounds b/compiler/testData/constraintSystem/severalVariables/recursive/simpleRecursive.bounds index ec71b874753..884500e81a7 100644 --- a/compiler/testData/constraintSystem/severalVariables/recursive/simpleRecursive.bounds +++ b/compiler/testData/constraintSystem/severalVariables/recursive/simpleRecursive.bounds @@ -4,11 +4,11 @@ EQUAL T Int EQUAL T My type parameter bounds: -T := Int, := My* +T := Int, := My*, := My status: -hasCannotCaptureTypesError: false --hasConflictingConstraints: false +-hasConflictingConstraints: true -hasContradiction: true -hasErrorInConstrainingTypes: false -hasTypeConstructorMismatch: false @@ -18,4 +18,4 @@ status: -isSuccessful: false result: -T=Int +T=??? \ No newline at end of file diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt index a8ee4f0d69f..669b32d7c83 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/constraintIncorporation.kt @@ -75,9 +75,6 @@ private fun ConstraintSystemImpl.generateNewBound(bound: Bound, substitution: Bo // Here <=> means lower_bound, upper_bound or exact_bound constraint. // Then a new bound 'T <=> My<_/in/out Type>' can be generated. - // We don't substitute anything into recursive constraints - if (substitution.typeVariable == bound.typeVariable) return - val substitutedType = when (substitution.kind) { EXACT_BOUND -> substitution.constrainingType UPPER_BOUND -> CapturedType(TypeProjectionImpl(Variance.OUT_VARIANCE, substitution.constrainingType))