diff options
author | Martin Odersky <odersky@gmail.com> | 2015-04-27 21:49:30 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-04-28 12:07:29 +0200 |
commit | a4d86e9640e33506d9c9cec625567907a82cd16f (patch) | |
tree | 27839099e2fbc1784003028c762129c1a3b7e224 /src | |
parent | 12f2ee7042c8f44a81afa54bdf261d4cd2a31b9c (diff) | |
download | dotty-a4d86e9640e33506d9c9cec625567907a82cd16f.tar.gz dotty-a4d86e9640e33506d9c9cec625567907a82cd16f.tar.bz2 dotty-a4d86e9640e33506d9c9cec625567907a82cd16f.zip |
Fix definition of empty package so that it can persist members
Previously, the empty package was always initialized with the empty scope.
This means that separate compilation between files in the empty package
was not possible.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Definitions.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 7de254008..3c36b1a1e 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -4,7 +4,7 @@ package core import Types._, Contexts._, Symbols._, Denotations._, SymDenotations._, StdNames._, Names._ import Flags._, Scopes._, Decorators._, NameOps._, util.Positions._ -import pickling.UnPickler.ensureConstructor +import pickling.Scala2Unpickler.ensureConstructor import scala.annotation.{ switch, meta } import scala.collection.{ mutable, immutable } import PartialFunction._ @@ -99,7 +99,8 @@ class Definitions { lazy val RootPackage: TermSymbol = ctx.newSymbol( NoSymbol, nme.ROOTPKG, PackageCreationFlags, TypeRef(NoPrefix, RootClass)) - lazy val EmptyPackageVal = ctx.newCompletePackageSymbol(RootClass, nme.EMPTY_PACKAGE).entered + lazy val EmptyPackageVal = ctx.newPackageSymbol( + RootClass, nme.EMPTY_PACKAGE, (emptypkg, emptycls) => ctx.rootLoader(emptypkg)).entered lazy val EmptyPackageClass = EmptyPackageVal.moduleClass.asClass /** A package in which we can place all methods that are interpreted specially by the compiler */ |