diff options
-rw-r--r-- | src/dotty/tools/dotc/parsing/Parsers.scala | 3 | ||||
-rw-r--r-- | tests/pos/i1703.scala | 5 |
2 files changed, 7 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 { diff --git a/tests/pos/i1703.scala b/tests/pos/i1703.scala new file mode 100644 index 000000000..9d17b5e81 --- /dev/null +++ b/tests/pos/i1703.scala @@ -0,0 +1,5 @@ +class DuplicateClassName { () => { + { () => + } +} +} |