Skip to content

Commit 2534faa

Browse files
committed
Fix infinite loop in parser when parsing enums
1 parent 2627c10 commit 2534faa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ object Parsers {
21512151
/** EnumCaseStats = EnumCaseStat {semi EnumCaseStat */
21522152
def enumCaseStats(): List[DefTree] = {
21532153
val cases = new ListBuffer[DefTree] += enumCaseStat()
2154-
while (in.token != RBRACE) {
2154+
while (in.token != RBRACE && in.token != EOF) {
21552155
acceptStatSep()
21562156
cases += enumCaseStat()
21572157
}

0 commit comments

Comments
 (0)