From 7bf837c79315e5db7e049f3ffeb6c6842d18880c Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 16 Mar 2014 21:39:18 +0100 Subject: Fix of t0774: empty file Was previously wrapped in a package but the resulting tree had no position, which caused a Typer assertion. If now represented as EmptyTree. --- src/dotty/tools/dotc/parsing/Parsers.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'src/dotty/tools/dotc') diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index aea019bed..7bc7d5516 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2071,6 +2071,7 @@ object Parsers { topstats() match { case List(stat @ PackageDef(_, _)) => stat + case Nil => EmptyTree // without this case we'd get package defs without positions case stats => PackageDef(Ident(nme.EMPTY_PACKAGE), stats) } } -- cgit v1.2.3