diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-10 01:43:32 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-10 01:43:32 +0100 |
commit | a6936756bde8bc081f1a0623c1abd1f12be0a649 (patch) | |
tree | d30a2a5cd6483243d4b89d44bea638c7300cfa56 /src | |
parent | fce100c1e084b8f7f031f3699033a7b240a241b7 (diff) | |
download | dotty-a6936756bde8bc081f1a0623c1abd1f12be0a649.tar.gz dotty-a6936756bde8bc081f1a0623c1abd1f12be0a649.tar.bz2 dotty-a6936756bde8bc081f1a0623c1abd1f12be0a649.zip |
Add type parameters to synthetic constructors.
Diffstat (limited to 'src')
-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 |