summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index d42803cf8a..f72e45bd99 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -2734,10 +2734,10 @@ self =>
topstats() match {
case List(stat @ PackageDef(_, _)) => stat
case stats =>
- val start = stats match {
- case Nil => 0
- case _ => wrappingPos(stats).startOrPoint
- }
+ val start =
+ if (stats forall (_ == EmptyTree)) 0
+ else wrappingPos(stats).startOrPoint
+
makePackaging(start, atPos(start, start, start) { Ident(nme.EMPTY_PACKAGE_NAME) }, stats)
}
}