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
|
||||
|
||||
Reference in New Issue
Block a user