diff options
author | Martin Odersky <odersky@gmail.com> | 2013-04-05 18:12:07 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-04-05 18:12:07 +0200 |
commit | eb781570824840e5b402a719e8b3e7c91a86a3d2 (patch) | |
tree | 33dfb4e118882cc7b67e75e62119c6f2fc21c846 /src/dotty/tools/dotc/core/pickling/UnPickler.scala | |
parent | 1ff51dc830b626f2344fc40552c841a0a2020614 (diff) | |
download | dotty-eb781570824840e5b402a719e8b3e7c91a86a3d2.tar.gz dotty-eb781570824840e5b402a719e8b3e7c91a86a3d2.tar.bz2 dotty-eb781570824840e5b402a719e8b3e7c91a86a3d2.zip |
Fixed sourceModule fallback, adapting to new module class naming scheme.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index bed88e1dd..2c635d092 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -7,7 +7,7 @@ import java.io.IOException import java.lang.Float.intBitsToFloat import java.lang.Double.longBitsToDouble -import Contexts._, Symbols._, Types._, Scopes._, SymDenotations._, Names._ +import Contexts._, Symbols._, Types._, Scopes._, SymDenotations._, Names._, NameOps._ import StdNames._, Denotations._, NameOps._, Flags._, Constants._, Annotations._ import Positions._, TypedTrees.tpd._, TypedTrees.TreeOps import util.Texts._ @@ -114,10 +114,12 @@ object UnPickler { if (ost == NoType && (denot is ModuleClass)) { var module = denot.sourceModule if (!module.isTerm) { - println(s"$denot does not have a sourceModule ${denot.completer} of class ${denot.completer.getClass}") - // 2nd try: read form precomplete decls - module = denot.owner.preCompleteDecls.lookup(denot.name.toTermName) - .suchThat(_ is Module).symbol + // 2nd try: read from precomplete decls + module = denot.owner.preCompleteDecls.lookup( + denot.name.stripModuleClassSuffix.toTermName) + .suchThat(_ is Module).symbol + if (!module.isTerm) // !!! DEBUG + println(s"panic: $denot ${denot.owner} ${denot.owner.preCompleteDecls}") } ost = TermRef(denot.owner.thisType, module.asTerm) } |