From f2e8f8c9c53f48476230b8d823f65ccbbcf50487 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Tue, 10 Jul 2012 15:11:54 +0400 Subject: [PATCH] changed to right way to check type inference error presence --- .../jet/lang/types/expressions/ExpressionTypingServices.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 101aecffbb4..fc18978a452 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 @@ -20,6 +20,8 @@ import com.google.common.collect.Lists; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; import com.intellij.psi.tree.IElementType; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.psi.util.PsiUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; @@ -366,7 +368,8 @@ public class ExpressionTypingServices { if (diagnostic.getFactory() == TYPE_MISMATCH && diagnostic.getPsiElement() == expressionToWatch) { mismatchFound[0] = true; } - if (TYPE_INFERENCE_ERRORS.contains(diagnostic.getFactory()) && diagnostic.getPsiElement().getParent() == expressionToWatch) { + if (TYPE_INFERENCE_ERRORS.contains(diagnostic.getFactory()) && + PsiTreeUtil.getParentOfType(diagnostic.getPsiElement(), JetQualifiedExpression.class, false) == expressionToWatch) { mismatchFound[0] = true; } super.report(diagnostic);