From ca0f2283b5af983b4d2199ba6e75d05fca1a4ad1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 16 Nov 2016 15:30:11 +0100 Subject: Fix #1703 - survive illegal self type clause Since self types are critical we should only install one if it is syntactcally correct. Fixes #1703. --- src/dotty/tools/dotc/parsing/Parsers.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/parsing/Parsers.scala') 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 { -- cgit v1.2.3