diff options
author | Martin Odersky <odersky@gmail.com> | 2013-08-16 19:01:08 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-08-16 19:01:08 +0200 |
commit | 502f426981105df448896f635ef559cd72787c43 (patch) | |
tree | ca3a85271ae10c7f697dd3e88b07b7045bf81e2e /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | f540194f1b04c044c969772d5989d129264ea781 (diff) | |
download | dotty-502f426981105df448896f635ef559cd72787c43.tar.gz dotty-502f426981105df448896f635ef559cd72787c43.tar.bz2 dotty-502f426981105df448896f635ef559cd72787c43.zip |
Various bugfixes for namer/typer/trees
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) |