Skip to content

Commit b482db8

Browse files
committed
Adapt sourceModule to new selfInfo scheme.
1 parent 9421e61 commit b482db8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,11 @@ object SymDenotations {
736736

737737
/** The module implemented by this module class, NoSymbol if not applicable. */
738738
final def sourceModule(implicit ctx: Context): Symbol = myInfo match {
739-
case ClassInfo(_, _, _, _, selfType: TermRef) if this is ModuleClass =>
740-
selfType.symbol
739+
case ClassInfo(_, _, _, _, selfType) if this is ModuleClass =>
740+
selfType match {
741+
case selfType: TermRef => selfType.symbol
742+
case selfType: Symbol => selfType.info.asInstanceOf[TermRef].symbol
743+
}
741744
case info: LazyType =>
742745
info.sourceModule
743746
case _ =>

src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class Namer { typer: Typer =>
278278
val cls = recordSym(ctx.newClassSymbol(
279279
ctx.owner, name, flags | inSuperCall,
280280
cls => adjustIfModule(new ClassCompleter(cls, tree)(ctx), tree),
281-
privateWithinClass(tree.mods), tree.pos, ctx.source.file)SyS, tree)
281+
privateWithinClass(tree.mods), tree.pos, ctx.source.file), tree)
282282
cls.completer.asInstanceOf[ClassCompleter].init()
283283
cls
284284
case tree: MemberDef =>

0 commit comments

Comments
 (0)