Skip to content

Commit 7113db7

Browse files
b-studiosfelixmulder
authored andcommitted
Improve error position and drop second error since it is pruned
1 parent 42227a6 commit 7113db7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ object Parsers {
540540
def handleThis(qual: Ident) = {
541541
in.nextToken()
542542
val t = atPos(start) { This(qual) }
543-
if (!thisOK && in.token != DOT) syntaxError(DanglingThisInPath(), start)
543+
if (!thisOK && in.token != DOT) syntaxError(DanglingThisInPath(), t.pos)
544544
dotSelectors(t, finish)
545545
}
546546
def handleSuper(qual: Ident) = {

tests/neg/i1845.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
object Test {
22
type X = FooBar22.this // error
3-
} // error
3+
}

0 commit comments

Comments
 (0)