diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-15 10:26:46 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-15 10:27:13 +0100 |
commit | 79aadfe04c4b3aaae4f56ea6a35c7cac61c4af77 (patch) | |
tree | 4c986a8b5a03ff601648f39c2c2df300cf602574 /src/dotty/tools/dotc/typer/Namer.scala | |
parent | de53428d957c07333aa765e826fdbb4022229d2d (diff) | |
download | dotty-79aadfe04c4b3aaae4f56ea6a35c7cac61c4af77.tar.gz dotty-79aadfe04c4b3aaae4f56ea6a35c7cac61c4af77.tar.bz2 dotty-79aadfe04c4b3aaae4f56ea6a35c7cac61c4af77.zip |
Treat "this" specially when it appears in a parent constructor
In this case its owner is the next outer class, not the currently defined one.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index c0e39c44c..d10ac9fb2 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -372,7 +372,7 @@ class Namer { typer: Typer => /** The type of a parent constructor. Types constructor arguments * only if parent type contains uninstantiated type parameters. */ - def parentType(constr: untpd.Tree): Type = + def parentType(constr: untpd.Tree)(implicit ctx: Context): Type = if (constr.isType) { // this case applies to desugared refined types typedAheadType(constr).tpe } else { @@ -393,7 +393,7 @@ class Namer { typer: Typer => else createSymbol(self) // pre-set info, so that parent types can refer to type params denot.info = ClassInfo(cls.owner.thisType, cls, Nil, decls, selfInfo) - val parentTypes = parents map parentType + val parentTypes = parents map (parentType(_)(ctx.fresh addMode Mode.InSuperCall)) val parentRefs = ctx.normalizeToClassRefs(parentTypes, cls, decls) val parentClsRefs = for ((parentRef, constr) <- parentRefs zip parents) |