Skip to content

Fix #1865: Compute outer path at right phase #1873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 5, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 3, 2017

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.

Review by @DarkDimius ?

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.
@@ -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)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is somewhat subtle, I would add a comment here that restates what is in the commit message.

@@ -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}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stray println

@@ -0,0 +1,24 @@
class AbsCell {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is in tests/pending/ so we're not actually running it

@odersky odersky merged commit 42eb864 into scala:master Jan 5, 2017
@allanrenucci allanrenucci deleted the fix-#1865 branch December 14, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants