From 2534faa8b5c94b37e59e4601c3bf67b7adcb5f18 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Mon, 17 Apr 2017 16:40:22 +0200 Subject: Fix infinite loop in parser when parsing enums --- compiler/src/dotty/tools/dotc/parsing/Parsers.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 3112be659..9f393df00 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2151,7 +2151,7 @@ object Parsers { /** EnumCaseStats = EnumCaseStat {semi EnumCaseStat */ def enumCaseStats(): List[DefTree] = { val cases = new ListBuffer[DefTree] += enumCaseStat() - while (in.token != RBRACE) { + while (in.token != RBRACE && in.token != EOF) { acceptStatSep() cases += enumCaseStat() } -- cgit v1.2.3