[K2, CLI] Support endOffset in Kotlin CLI

Duplicated messages in testdata appeared because default renderer
renders diagnostic spans ambiguously. It shows only start position.
In fact, there are 3 failures, 2 of them distinguish only by the
diagnostic end offset. See youtrack for more information.

The issue about inconvenient rendering is KT-64989.

#KT-64608
This commit is contained in:
Evgeniy.Zhelenskiy
2024-01-12 03:08:09 +01:00
committed by Space Team
parent 6404cede07
commit f05c972efb
12 changed files with 154 additions and 28 deletions
@@ -5,4 +5,7 @@ compiler/testData/compileKotlinAgainstCustomBinaries/againstFirWithUnstableAbi/s
compiler/testData/compileKotlinAgainstCustomBinaries/againstFirWithUnstableAbi/source.kt:4:11: error: class 'lib.Box' is compiled by an unstable version of the Kotlin compiler and cannot be loaded by this compiler.
get { Box("OK").value }
^
compiler/testData/compileKotlinAgainstCustomBinaries/againstFirWithUnstableAbi/source.kt:4:11: error: class 'lib.Box' is compiled by an unstable version of the Kotlin compiler and cannot be loaded by this compiler.
get { Box("OK").value }
^
COMPILATION_ERROR
@@ -5,4 +5,7 @@ compiler/testData/compileKotlinAgainstCustomBinaries/againstUnstable/source.kt:4
compiler/testData/compileKotlinAgainstCustomBinaries/againstUnstable/source.kt:4:11: error: class 'lib.Box' is compiled by an unstable version of the Kotlin compiler and cannot be loaded by this compiler.
get { Box("OK").value }
^
compiler/testData/compileKotlinAgainstCustomBinaries/againstUnstable/source.kt:4:11: error: class 'lib.Box' is compiled by an unstable version of the Kotlin compiler and cannot be loaded by this compiler.
get { Box("OK").value }
^
COMPILATION_ERROR
@@ -17,6 +17,10 @@ The class is loaded from $TMP_DIR$/library-after.jar!/a/A$Nested.class
val nested = A.Nested()
^
compiler/testData/compileKotlinAgainstCustomBinaries/wrongMetadataVersion/source.kt:8:22: error: class 'a.A' was compiled with an incompatible version of Kotlin. The actual metadata version is 42.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION_NEXT$.
The class is loaded from $TMP_DIR$/library-after.jar!/a/A.class
val methodCall = param.method()
^
compiler/testData/compileKotlinAgainstCustomBinaries/wrongMetadataVersion/source.kt:8:22: error: class 'a.A' was compiled with an incompatible version of Kotlin. The actual metadata version is 42.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION_NEXT$.
The class is loaded from $TMP_DIR$/library-after.jar!/a/A.class
val methodCall = param.method()
^
@@ -17,6 +17,10 @@ The class is loaded from $TMP_DIR$/library-after.jar!/a/A$Nested.class
val nested = A.Nested()
^
compiler/testData/compileKotlinAgainstCustomBinaries/wrongMetadataVersionSkipPrereleaseCheckHasNoEffect/source.kt:8:22: error: class 'a.A' was compiled with an incompatible version of Kotlin. The actual metadata version is 42.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION_NEXT$.
The class is loaded from $TMP_DIR$/library-after.jar!/a/A.class
val methodCall = param.method()
^
compiler/testData/compileKotlinAgainstCustomBinaries/wrongMetadataVersionSkipPrereleaseCheckHasNoEffect/source.kt:8:22: error: class 'a.A' was compiled with an incompatible version of Kotlin. The actual metadata version is 42.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION_NEXT$.
The class is loaded from $TMP_DIR$/library-after.jar!/a/A.class
val methodCall = param.method()
^