aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 7cca608e6..e9e4d4c87 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -432,18 +432,10 @@ class Namer { typer: Typer =>
}
def createLinks(classTree: TypeDef, moduleTree: TypeDef)(implicit ctx: Context) = {
- val claz = ctx.denotNamed(classTree.name.encode)
- val modl = ctx.denotNamed(moduleTree.name.encode)
- ctx.newSymbol(
- owner = modl.symbol,
- name = nme.COMPANION_CLASS_METHOD,
- flags = Flags.Synthetic | Flags.Private,
- info = ExprType(claz.symbol.typeRef)).entered
- ctx.newSymbol(
- owner = claz.symbol,
- name = nme.COMPANION_MODULE_METHOD,
- flags = Flags.Synthetic | Flags.Private,
- info = ExprType(modl.symbol.typeRef)).entered
+ val claz = ctx.denotNamed(classTree.name.encode).symbol
+ val modl = ctx.denotNamed(moduleTree.name.encode).symbol
+ ctx.synthesizeCompanionMethod(nme.COMPANION_CLASS_METHOD, claz, modl).entered
+ ctx.synthesizeCompanionMethod(nme.COMPANION_MODULE_METHOD, modl, claz).entered
}
def createCompanionLinks(implicit ctx: Context): Unit = {