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 4458da5 commit 7058075Copy full SHA for 7058075
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1929,7 +1929,10 @@ object Parsers {
1929
commaSeparated(importExpr) match {
1930
case t :: rest =>
1931
// The first import should start at the position of the keyword.
1932
- t.withPos(t.pos.withStart(offset)) :: rest
+ val firstPos =
1933
+ if (t.pos.exists) t.pos.withStart(offset)
1934
+ else Position(offset, in.lastOffset)
1935
+ t.withPos(firstPos) :: rest
1936
case nil => nil
1937
}
1938
tests/neg/parser-stability-9.scala
@@ -0,0 +1 @@
1
+import // error
0 commit comments