diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index d2b2a6fe4..910fec909 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -437,11 +437,15 @@ object SymDenotations { * the completers. */ /** The class implementing this module, NoSymbol if not applicable. */ - final def moduleClass: Symbol = myInfo match { - case info: TypeRefBySym if this is ModuleVal => info.fixedSym - case info: ModuleCompleter => info.mclass - case _ => NoSymbol - } + final def moduleClass: Symbol = + if (this is ModuleVal) + myInfo match { + case info: TypeRefBySym => info.fixedSym + case ExprType(info: TypeRefBySym) => info.fixedSym // needed after uncurry, when module terms might be accessor defs + case info: ModuleCompleter => info.mclass + case _ => NoSymbol + } + else NoSymbol /** The module implemented by this module class, NoSymbol if not applicable. */ final def sourceModule: Symbol = myInfo match { @@ -841,6 +845,10 @@ object SymDenotations { case scope: MutableScope => scope case _ => decls.asInstanceOf[MutableScope] } + if (this is PackageClass) { // replace existing symbols + val entry = mscope.lookupEntry(sym.name) + if (entry != null) mscope.unlink(entry) + } mscope.enter(sym) if (myMemberFingerPrint != FingerPrint.unknown) |