Don't stop constraints processing if all type variables have proper equality constraints

Those type variable may have other constraints after incorporation into which, the constraint error may appear

^KT-42042 Fixed
This commit is contained in:
Victor Petukhov
2021-03-03 16:34:00 +03:00
parent 7f7bb70596
commit b87c2a15b5
13 changed files with 61 additions and 19 deletions
@@ -122,17 +122,6 @@ class ConstraintInjector(
constraintIncorporator.incorporate(typeCheckerContext, typeVariable, constraintToIncorporate)
}
}
val contextOps = c as? ConstraintSystemOperation
if (!typeCheckerContext.hasConstraintsToProcess() ||
(contextOps != null && c.notFixedTypeVariables.all { typeVariable ->
typeVariable.value.constraints.any { constraint ->
constraint.kind == EQUALITY && contextOps.isProperType(constraint.type)
}
})
) {
break
}
}
}