aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/TypeAssigner.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-11-01 18:33:56 +0100
committerMartin Odersky <odersky@gmail.com>2014-11-09 19:08:58 +0100
commit43075bb832c3b4fe080c24a20ecf8c4737d5cdd2 (patch)
tree680cc886c536c34b4c3718663386d1cb13be4924 /src/dotty/tools/dotc/typer/TypeAssigner.scala
parent0119ffd3e285e43b63fb9c43c1c8b009174a1987 (diff)
downloaddotty-43075bb832c3b4fe080c24a20ecf8c4737d5cdd2.tar.gz
dotty-43075bb832c3b4fe080c24a20ecf8c4737d5cdd2.tar.bz2
dotty-43075bb832c3b4fe080c24a20ecf8c4737d5cdd2.zip
Improved version of mixin.
Now also handles all supercalls. Seems to do the right thing on pos/traits.scala. But does not pass most tests because the sym transformer forces too many things.
Diffstat (limited to 'src/dotty/tools/dotc/typer/TypeAssigner.scala')
-rw-r--r--src/dotty/tools/dotc/typer/TypeAssigner.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/TypeAssigner.scala b/src/dotty/tools/dotc/typer/TypeAssigner.scala
index bb488bdc5..ed10c7644 100644
--- a/src/dotty/tools/dotc/typer/TypeAssigner.scala
+++ b/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -236,7 +236,7 @@ trait TypeAssigner {
tree.withType(cls.thisType)
}
- def assignType(tree: untpd.Super, qual: Tree, inConstrCall: Boolean)(implicit ctx: Context) = {
+ def assignType(tree: untpd.Super, qual: Tree, inConstrCall: Boolean, mixinClass: Symbol = NoSymbol)(implicit ctx: Context) = {
val mix = tree.mix
val cls = qual.tpe.widen.typeSymbol
@@ -249,7 +249,8 @@ trait TypeAssigner {
errorType("ambiguous parent class qualifier", tree.pos)
}
val owntype =
- if (!mix.isEmpty) findMixinSuper(cls.info)
+ if (mixinClass.exists) mixinClass.typeRef
+ else if (!mix.isEmpty) findMixinSuper(cls.info)
else if (inConstrCall || ctx.erasedTypes) cls.info.firstParent
else {
val ps = cls.info.parents