From 7113db7a638868edd72e5f1a89a16ed85641a20f Mon Sep 17 00:00:00 2001 From: Jonathan Brachthäuser Date: Sun, 8 Jan 2017 16:37:33 +0100 Subject: Improve error position and drop second error since it is pruned --- compiler/src/dotty/tools/dotc/parsing/Parsers.scala | 2 +- tests/neg/i1845.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 20a507213..f62093db0 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -540,7 +540,7 @@ object Parsers { def handleThis(qual: Ident) = { in.nextToken() val t = atPos(start) { This(qual) } - if (!thisOK && in.token != DOT) syntaxError(DanglingThisInPath(), start) + if (!thisOK && in.token != DOT) syntaxError(DanglingThisInPath(), t.pos) dotSelectors(t, finish) } def handleSuper(qual: Ident) = { diff --git a/tests/neg/i1845.scala b/tests/neg/i1845.scala index e3e5787e6..1ecffdc7d 100644 --- a/tests/neg/i1845.scala +++ b/tests/neg/i1845.scala @@ -1,3 +1,3 @@ object Test { type X = FooBar22.this // error -} // error +} -- cgit v1.2.3