Skip to content

Commit 528bccf

Browse files
authored
Merge pull request #1718 from dotty-staging/fix-#1703
Fix #1703
2 parents 0397af7 + 4eca276 commit 528bccf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,8 @@ object Parsers {
21492149
self = makeSelfDef(nme.WILDCARD, tpt).withPos(first.pos)
21502150
case _ =>
21512151
val ValDef(name, tpt, _) = convertToParam(first, expected = "self type clause")
2152-
self = makeSelfDef(name, tpt).withPos(first.pos)
2152+
if (name != nme.ERROR)
2153+
self = makeSelfDef(name, tpt).withPos(first.pos)
21532154
}
21542155
in.nextToken()
21552156
} else {

tests/neg/i1703.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class DuplicateClassName { () => { // error: not a legal self type clause
2+
{ () =>
3+
}
4+
}
5+
}

0 commit comments

Comments
 (0)