Fix assertion in light tree diagnostic reporter
happened then two diagnostics are reported on the same element. #KT-55924 fixed
This commit is contained in:
committed by
Space Team
parent
3b9aac067a
commit
7ec72b568d
+1
-1
@@ -162,10 +162,10 @@ private class SequentialFilePositionFinder(file: File) : Closeable {
|
||||
|
||||
// assuming that if called multiple times, calls should be sorted by ascending offset
|
||||
fun findNextPosition(offset: Int, withLineContents: Boolean = true): KtSourceFilePos {
|
||||
assert(offset >= charsRead - (currentLineContent?.length ?: 0))
|
||||
|
||||
fun posInCurrentLine(): KtSourceFilePos? {
|
||||
val col = offset - (charsRead - currentLineContent!!.length - 1)/* beginning of line offset */ + 1 /* col is 1-based */
|
||||
assert(col > 0)
|
||||
return if (col <= currentLineContent!!.length)
|
||||
KtSourceFilePos(currentLine, col, if (withLineContents) currentLineContent else null)
|
||||
else null
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
-Xuse-fir-lt=true
|
||||
-language-version
|
||||
2.0
|
||||
$TESTDATA_DIR$/twoDiagnosticsOnSingleElement.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
interface I1 {
|
||||
fun <T> foo()
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class C : I1, I2
|
||||
@@ -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/twoDiagnosticsOnSingleElement.kt:11:1: error: class C is not abstract and does not implement abstract member foo
|
||||
class C : I1, I2
|
||||
^
|
||||
compiler/testData/cli/jvm/twoDiagnosticsOnSingleElement.kt:11:1: error: c inherits conflicting members: foo, foo
|
||||
class C : I1, I2
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -1077,6 +1077,11 @@ public class CliTestGenerated extends AbstractCliTest {
|
||||
runTest("compiler/testData/cli/jvm/syntheticAccessorSignatureClash.args");
|
||||
}
|
||||
|
||||
@TestMetadata("twoDiagnosticsOnSingleElement.args")
|
||||
public void testTwoDiagnosticsOnSingleElement() throws Exception {
|
||||
runTest("compiler/testData/cli/jvm/twoDiagnosticsOnSingleElement.args");
|
||||
}
|
||||
|
||||
@TestMetadata("unknownExtraFlags.args")
|
||||
public void testUnknownExtraFlags() throws Exception {
|
||||
runTest("compiler/testData/cli/jvm/unknownExtraFlags.args");
|
||||
|
||||
Reference in New Issue
Block a user