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 997ef40c1fb..902de8fe6a4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -252,7 +252,7 @@ public interface Errors { JetBlockExpression blockExpression = (JetBlockExpression)bodyExpression; TextRange lastBracketRange = blockExpression.getLastBracketRange(); if (lastBracketRange == null) { - return markElement(element); + return Collections.emptyList(); } return markRange(lastBracketRange); } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/kt1955.jet b/compiler/testData/diagnostics/tests/incompleteCode/kt1955.jet new file mode 100644 index 00000000000..e0821228b58 --- /dev/null +++ b/compiler/testData/diagnostics/tests/incompleteCode/kt1955.jet @@ -0,0 +1,8 @@ +//KT-1955 Half a file is red on incomplete code + +package b + +fun foo() { + val a = 1 + +