From 2b806e717d6f0a751b14308c746bdab27c484763 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Tue, 27 Apr 2021 14:19:19 +0300 Subject: [PATCH] FIR: Avoid adding new constraints when system already has contradictions --- .../kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt index bc470b362a7..4d1c96ddeef 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt @@ -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,