diff options
author | Martin Odersky <odersky@gmail.com> | 2016-11-16 15:30:11 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-11-16 15:30:16 +0100 |
commit | ca0f2283b5af983b4d2199ba6e75d05fca1a4ad1 (patch) | |
tree | 6a763a5ddc9b857b88f1863b0b45429ba4b44424 /src/dotty/tools/dotc/parsing/Parsers.scala | |
parent | fb59174be6193d7cb05bea6d375e34ec1cd52f46 (diff) | |
download | dotty-ca0f2283b5af983b4d2199ba6e75d05fca1a4ad1.tar.gz dotty-ca0f2283b5af983b4d2199ba6e75d05fca1a4ad1.tar.bz2 dotty-ca0f2283b5af983b4d2199ba6e75d05fca1a4ad1.zip |
Fix #1703 - survive illegal self type clause
Since self types are critical we should only install
one if it is syntactcally correct.
Fixes #1703.
Diffstat (limited to 'src/dotty/tools/dotc/parsing/Parsers.scala')
-rw-r--r-- | src/dotty/tools/dotc/parsing/Parsers.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index f442c13b3..828d47a17 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2149,7 +2149,8 @@ object Parsers { self = makeSelfDef(nme.WILDCARD, tpt).withPos(first.pos) case _ => val ValDef(name, tpt, _) = convertToParam(first, expected = "self type clause") - self = makeSelfDef(name, tpt).withPos(first.pos) + if (name != nme.ERROR) + self = makeSelfDef(name, tpt).withPos(first.pos) } in.nextToken() } else { |