From e8f9097127843a3e56cd594da91c12430c178525 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Sat, 17 Nov 2012 19:55:34 +0400 Subject: [PATCH] do not mark error type if the expression is resolved to namespace (EXPRESSION_EXPECTED_NAMESPACE_FOUND error) --- .../src/org/jetbrains/jet/checkers/DebugInfoUtil.java | 3 +++ .../testData/diagnostics/tests/NamespaceAsExpression.kt | 2 +- .../diagnostics/tests/NamespaceInExpressionPosition.kt | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/checkers/DebugInfoUtil.java b/compiler/frontend/src/org/jetbrains/jet/checkers/DebugInfoUtil.java index 0d62832e484..572aaf4cd72 100644 --- a/compiler/frontend/src/org/jetbrains/jet/checkers/DebugInfoUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/checkers/DebugInfoUtil.java @@ -70,6 +70,9 @@ public class DebugInfoUtil { JetSuperExpression superExpression = (JetSuperExpression) diagnostic.getPsiElement(); markedWithErrorElements.put(superExpression.getInstanceReference(), factory); } + else if (factory == Errors.EXPRESSION_EXPECTED_NAMESPACE_FOUND) { + markedWithErrorElements.put((JetSimpleNameExpression) diagnostic.getPsiElement(), factory); + } } root.acceptChildren(new JetTreeVisitorVoid() { diff --git a/compiler/testData/diagnostics/tests/NamespaceAsExpression.kt b/compiler/testData/diagnostics/tests/NamespaceAsExpression.kt index f26e6530f3d..9d2ca455811 100644 --- a/compiler/testData/diagnostics/tests/NamespaceAsExpression.kt +++ b/compiler/testData/diagnostics/tests/NamespaceAsExpression.kt @@ -4,5 +4,5 @@ package root.a // FILE: b.kt package root -val x = a +val x = a val y2 = package \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.kt b/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.kt index 3db9bca3991..740ed2c0b3a 100644 --- a/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.kt +++ b/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.kt @@ -2,10 +2,10 @@ package foo class X {} -val s = java +val s = java val ss = System val sss = X -val xs = java.lang +val xs = java.lang val xss = java.lang.System val xsss = foo.X -val xssss = foo \ No newline at end of file +val xssss = foo \ No newline at end of file