FIR LT: Fix diagnostic location calculation on the last line

it was calculated incorrectly on the last line that do not end
with EOL.
#KT-56649 fixed
This commit is contained in:
Ilya Chernikov
2023-02-14 17:06:58 +01:00
committed by Space Team
parent d120d83d60
commit e39eb62e6e
11 changed files with 61 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
$TESTDATA_DIR$/firErrorOnLastLine.kt
-language-version
2.0
-Xuse-fir-lt=true
-d
$TEMP_DIR$
+2
View File
@@ -0,0 +1,2 @@
val x = this
val y = this // EOL AFTER THIS LINE!
+8
View File
@@ -0,0 +1,8 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/firErrorOnLastLine.kt:1:9: error: 'this' is not defined in this context
val x = this
^
compiler/testData/cli/jvm/firErrorOnLastLine.kt:2:9: error: 'this' is not defined in this context
val y = this // EOL AFTER THIS LINE!
^
COMPILATION_ERROR
@@ -0,0 +1,6 @@
$TESTDATA_DIR$/firErrorOnLastLineNoEol.kt
-language-version
2.0
-Xuse-fir-lt=true
-d
$TEMP_DIR$
+2
View File
@@ -0,0 +1,2 @@
val x = this
val y = this // *NO* EOL AFTER THIS LINE!
+8
View File
@@ -0,0 +1,8 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/firErrorOnLastLineNoEol.kt:1:9: error: 'this' is not defined in this context
val x = this
^
compiler/testData/cli/jvm/firErrorOnLastLineNoEol.kt:2:9: error: 'this' is not defined in this context
val y = this // *NO* EOL AFTER THIS LINE!
^
COMPILATION_ERROR
+5
View File
@@ -0,0 +1,5 @@
$TESTDATA_DIR$/firSyntaxError.kt
-language-version
2.0
-d
$TEMP_DIR$
+1
View File
@@ -0,0 +1 @@
fun a() {
+5
View File
@@ -0,0 +1,5 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/firSyntaxError.kt:1:10: error: syntax error
fun a() {
^
COMPILATION_ERROR