Don't skip constraints from equations with the kind equal

The problem was that we didn't incorporate T == Foo into K <: Inv<out T>.
 It happened because of optimisation that isn't applicable here as we
 already have projection in the initial type

 #KT-39777 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-06-23 12:56:12 +03:00
parent ab34f8c738
commit a5ae1b38b0
6 changed files with 57 additions and 3 deletions
@@ -221,9 +221,10 @@ class ConstraintIncorporator(
val isFromVariableFixation = baseConstraint.position.from is FixVariableConstraintPosition
|| otherConstraint.position.from is FixVariableConstraintPosition
if (!containsConstrainingTypeWithoutProjection(newConstraint, otherConstraint)
&& !isUsefulForNullabilityConstraint
&& !isFromVariableFixation
if (!otherConstraint.kind.isEqual() &&
!isUsefulForNullabilityConstraint &&
!isFromVariableFixation &&
!containsConstrainingTypeWithoutProjection(newConstraint, otherConstraint)
) return
if (trivialConstraintTypeInferenceOracle.isGeneratedConstraintTrivial(