diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategy.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategy.java index 4e54884790a..a149ef32b69 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategy.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategy.java @@ -53,9 +53,6 @@ public class PositioningStrategy { protected static boolean hasSyntaxErrors(@NotNull PsiElement psiElement) { if (psiElement instanceof PsiErrorElement) return true; - PsiElement lastChild = psiElement.getLastChild(); - if (lastChild != null && hasSyntaxErrors(lastChild)) return true; - PsiElement[] children = psiElement.getChildren(); if (children.length > 0 && hasSyntaxErrors(children[children.length - 1])) return true; diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithRedeclarationError.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithRedeclarationError.kt new file mode 100644 index 00000000000..dd5e6721d8a --- /dev/null +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithRedeclarationError.kt @@ -0,0 +1,34 @@ +package c + +fun z(view: () -> Unit) {} + +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } +fun x() = z { z { z { z { z { z { z { z { } } } } } } } } + +class x() {} + diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 3e61475106b..d8339459aa4 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -5202,6 +5202,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage doTest("compiler/testData/diagnostics/tests/resolve/resolveWithGenerics.kt"); } + @TestMetadata("resolveWithRedeclarationError.kt") + public void testResolveWithRedeclarationError() throws Exception { + doTest("compiler/testData/diagnostics/tests/resolve/resolveWithRedeclarationError.kt"); + } + @TestMetadata("resolveWithSpecifiedFunctionLiteralWithId.kt") public void testResolveWithSpecifiedFunctionLiteralWithId() throws Exception { doTest("compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt");