aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-22 10:44:37 +0200
committerMartin Odersky <odersky@gmail.com>2015-10-22 13:29:41 +0200
commitb482db80c88f575390935b7d1cfbc60e5212f169 (patch)
tree8ca23ce7376f4aa6af83669bf531da05472a769d
parent9421e61051bf56329045250132e184065810ea13 (diff)
downloaddotty-b482db80c88f575390935b7d1cfbc60e5212f169.tar.gz
dotty-b482db80c88f575390935b7d1cfbc60e5212f169.tar.bz2
dotty-b482db80c88f575390935b7d1cfbc60e5212f169.zip
Adapt sourceModule to new selfInfo scheme.
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala7
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index d5ab09930..126af9259 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -736,8 +736,11 @@ object SymDenotations {
/** The module implemented by this module class, NoSymbol if not applicable. */
final def sourceModule(implicit ctx: Context): Symbol = myInfo match {
- case ClassInfo(_, _, _, _, selfType: TermRef) if this is ModuleClass =>
- selfType.symbol
+ case ClassInfo(_, _, _, _, selfType) if this is ModuleClass =>
+ selfType match {
+ case selfType: TermRef => selfType.symbol
+ case selfType: Symbol => selfType.info.asInstanceOf[TermRef].symbol
+ }
case info: LazyType =>
info.sourceModule
case _ =>
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 9143ff977..3f732f80c 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -278,7 +278,7 @@ class Namer { typer: Typer =>
val cls = recordSym(ctx.newClassSymbol(
ctx.owner, name, flags | inSuperCall,
cls => adjustIfModule(new ClassCompleter(cls, tree)(ctx), tree),
- privateWithinClass(tree.mods), tree.pos, ctx.source.file)SyS, tree)
+ privateWithinClass(tree.mods), tree.pos, ctx.source.file), tree)
cls.completer.asInstanceOf[ClassCompleter].init()
cls
case tree: MemberDef =>