aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
diff options
context:
space:
mode:
authorJonathan Brachthäuser <jonathan@b-studios.de>2016-12-21 17:08:59 +0100
committerFelix Mulder <felix.mulder@gmail.com>2017-01-08 20:11:15 +0100
commit3c2a293c96c6f1917341086c2cbd45558b90980f (patch)
tree8d7474bffbb56f4eec8136d95acae6f5713a013f /compiler/src/dotty/tools/dotc/parsing/Parsers.scala
parenta909c2fc9e95a227553ce3b0decc3aeec28b5d57 (diff)
downloaddotty-3c2a293c96c6f1917341086c2cbd45558b90980f.tar.gz
dotty-3c2a293c96c6f1917341086c2cbd45558b90980f.tar.bz2
dotty-3c2a293c96c6f1917341086c2cbd45558b90980f.zip
Add error message for dangling this in path selections
The following examples trigger the error message: val x: Foo.this = ??? // Also triggers the error: import foo.this // Additionally, also slays the compiler type X = Foo.this.type
Diffstat (limited to 'compiler/src/dotty/tools/dotc/parsing/Parsers.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/parsing/Parsers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala
index 18f0b42f5..5604cb9e4 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("`.' expected")
+ if (!thisOK && in.token != DOT) syntaxError(DanglingThisInPath(), start)
dotSelectors(t, finish)
}
def handleSuper(qual: Ident) = {