We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d362496 commit 652f94eCopy full SHA for 652f94e
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -565,7 +565,8 @@ object Parsers {
565
else Ident(name)
566
567
// Make sure that even trees with parsing errors have a offset that is within the offset
568
- if (tree.name == nme.ERROR && tree.span == NoSpan) tree.withSpan(Span(in.lastOffset - 1, in.lastOffset - 1))
+ val errorOffset = in.offset min (in.lastOffset - 1)
569
+ if (tree.name == nme.ERROR && tree.span == NoSpan) tree.withSpan(Span(errorOffset, errorOffset))
570
else tree
571
}
572
0 commit comments