From 1df826093a8bc3577bbf8fdb11d28d066f9470bc Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Tue, 3 Jul 2012 13:22:11 +0400 Subject: [PATCH] type inference error shouldn't influence on coercion to Unit --- .../jet/lang/types/expressions/ExpressionTypingServices.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.java index aca16de33e2..d7107b4c890 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.java @@ -44,6 +44,7 @@ import org.jetbrains.jet.lexer.JetTokens; import javax.inject.Inject; import java.util.*; +import static org.jetbrains.jet.lang.diagnostics.Errors.TYPE_INFERENCE_FAILED; import static org.jetbrains.jet.lang.diagnostics.Errors.TYPE_MISMATCH; import static org.jetbrains.jet.lang.resolve.BindingContext.LABEL_TARGET; import static org.jetbrains.jet.lang.resolve.BindingContext.STATEMENT; @@ -365,6 +366,9 @@ public class ExpressionTypingServices { if (diagnostic.getFactory() == TYPE_MISMATCH && diagnostic.getPsiElement() == expressionToWatch) { mismatchFound[0] = true; } + if (diagnostic.getFactory() == TYPE_INFERENCE_FAILED && diagnostic.getPsiElement().getParent() == expressionToWatch) { + mismatchFound[0] = true; + } super.report(diagnostic); } };