aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-01-03 19:12:18 +0700
committerMartin Odersky <odersky@gmail.com>2017-01-03 19:12:34 +0700
commitc40302cf0b0545cfe023fd5f8c833114398f8ff7 (patch)
tree446b2f52ed32fa15be071a710865eb5241775c2d /compiler/src/dotty/tools/dotc/transform
parent39c27b6a8aaa2c7303db54011082246ada06c0a0 (diff)
downloaddotty-c40302cf0b0545cfe023fd5f8c833114398f8ff7.tar.gz
dotty-c40302cf0b0545cfe023fd5f8c833114398f8ff7.tar.bz2
dotty-c40302cf0b0545cfe023fd5f8c833114398f8ff7.zip
Fix #1865: Compute outer path at right phase
When computing the outer path, we need to be careful to dealias before erasure, even if the outer path is demanded during erasure. Otherwise we lose prefixes.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
index 1eb12e9de..497b73807 100644
--- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
+++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
@@ -276,7 +276,7 @@ object ExplicitOuter {
if (tpe.prefix eq NoPrefix) cls.owner.enclosingClass.thisType
else tpe.prefix
case _ =>
- outerPrefix(tpe.underlying)
+ outerPrefix(tpe.underlying(ctx.withPhaseNoLater(ctx.erasurePhase)))
}
case tpe: TypeProxy =>
outerPrefix(tpe.underlying)
@@ -339,6 +339,7 @@ object ExplicitOuter {
val cls = fun.symbol.owner.asClass
def outerArg(receiver: Tree): Tree = receiver match {
case New(_) | Super(_, _) =>
+ println(i"outerarg: ${receiver.tpe} --> ${outerPrefix(receiver.tpe)} at ${ctx.phase}")
singleton(fixThis(outerPrefix(receiver.tpe)))
case This(_) =>
ref(outerParamAccessor(cls)) // will be rewired to outer argument of secondary constructor in phase Constructors