aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/UnPickler.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/UnPickler.scala9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
index e22d045ac..3466e8c8e 100644
--- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
@@ -120,12 +120,9 @@ object UnPickler {
if (!(denot.flagsUNSAFE is JavaModule)) ensureConstructor(denot.symbol.asClass, decls)
if (denot.flagsUNSAFE is Module) {
val scalacCompanion = denot.classSymbol.scalacLinkedClass
- if (scalacCompanion.exists)
- ctx.newSymbol(
- owner = denot.classSymbol,
- name = nme.COMPANION_CLASS_METHOD,
- flags = Flags.Synthetic | Flags.Private,
- info = ExprType(scalacCompanion.typeRef)).entered
+ val companionClassMethod = ctx.synthesizeCompanionMethod(nme.COMPANION_CLASS_METHOD, scalacCompanion, denot.classSymbol)
+ if (companionClassMethod.exists)
+ companionClassMethod.entered
}
denot.info = ClassInfo(denot.owner.thisType, denot.classSymbol, parentRefs, decls, ost)