FIR: Avoid adding new constraints when system already has contradictions

This commit is contained in:
Denis.Zharkov
2021-04-27 14:19:19 +03:00
committed by teamcityserver
parent 571c16be52
commit 2b806e717d
@@ -182,7 +182,7 @@ class PostponedArgumentsAnalyzer(
val lastExpressionCoercedToUnit =
it == lastExpression && expectedReturnType?.isUnitOrFlexibleUnit == true && !it.typeRef.coneType.isUnitOrFlexibleUnit
// No constraint for the last expression of lambda if it will be coerced to Unit.
if (!lastExpressionCoercedToUnit) {
if (!lastExpressionCoercedToUnit && !c.getBuilder().hasContradiction) {
candidate.resolveArgumentExpression(
c.getBuilder(),
it,