diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java index 189655ec333..3877588b9fc 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -51,7 +51,7 @@ public interface Errors { //Elements with "INVISIBLE_REFERENCE" error are marked as unresolved, unlike elements with "INVISIBLE_MEMBER" error DiagnosticFactory2 INVISIBLE_REFERENCE = DiagnosticFactory2.create(ERROR); - DiagnosticFactory2 INVISIBLE_MEMBER = DiagnosticFactory2.create(ERROR); + DiagnosticFactory2 INVISIBLE_MEMBER = DiagnosticFactory2.create(ERROR, PositioningStrategies.CALL_ELEMENT); RedeclarationDiagnosticFactory REDECLARATION = new RedeclarationDiagnosticFactory(ERROR); RedeclarationDiagnosticFactory NAME_SHADOWING = new RedeclarationDiagnosticFactory(WARNING); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java index eb98b2857c4..457a66cb034 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java @@ -151,4 +151,18 @@ public class PositioningStrategies { return markNode(element.getDefaultValue().getNode()); } }; + + public static PositioningStrategy CALL_ELEMENT = new PositioningStrategy() { + @NotNull + @Override + public List mark(@NotNull PsiElement callElement) { + if (callElement instanceof JetCallElement) { + JetExpression calleeExpression = ((JetCallElement) callElement).getCalleeExpression(); + if (calleeExpression != null) { + return markElement(calleeExpression); + } + } + return markElement(callElement); + } + }; } \ No newline at end of file