From b482db80c88f575390935b7d1cfbc60e5212f169 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 22 Oct 2015 10:44:37 +0200 Subject: Adapt sourceModule to new selfInfo scheme. --- src/dotty/tools/dotc/core/SymDenotations.scala | 7 +++++-- src/dotty/tools/dotc/typer/Namer.scala | 2 +- 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 => -- cgit v1.2.3