summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 071926e7c6..da156684c0 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -2771,7 +2771,11 @@ self =>
case stats =>
val start =
if (stats forall (_ == EmptyTree)) 0
- else wrappingPos(stats).startOrPoint
+ else {
+ val wpos = wrappingPos(stats)
+ if (wpos.isDefined) wpos.startOrPoint
+ else 0
+ }
makePackaging(start, atPos(start, start, start) { Ident(nme.EMPTY_PACKAGE_NAME) }, stats)
}