diff options
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 08d9458f4..041fe1963 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -919,7 +919,7 @@ object SymDenotations { * Note: We require that this does not happen after the first time * someone does a findMember on a subclass. */ - def enter(sym: Symbol, scope: Scope = EmptyScope)(implicit ctx: Context) = { + def enter(sym: Symbol, scope: Scope = EmptyScope)(implicit ctx: Context): Unit = { require(!(this is Frozen)) val mscope = scope match { case scope: MutableScope => scope diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index ba2845bd1..279e287ea 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -91,7 +91,11 @@ object UnPickler { } def ensureConstructor(cls: ClassSymbol, scope: Scope)(implicit ctx: Context) = - if (scope.lookup(nme.CONSTRUCTOR) == NoSymbol) cls.enter(ctx.newDefaultConstructor(cls), scope) + if (scope.lookup(nme.CONSTRUCTOR) == NoSymbol) { + val constr = ctx.newDefaultConstructor(cls) + addConstructorTypeParams(constr) + cls.enter(constr, scope) + } def setClassInfo(denot: ClassDenotation, info: Type, selfInfo: Type = NoType)(implicit ctx: Context): Unit = { val cls = denot.classSymbol |