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
Fixup symbol ownership in eta expansion #6186
Conversation
tree.changeOwner(typer.context.owner -> valSym) | ||
} | ||
valSym.setInfo(rhs.tpe) | ||
ValDef(valSym, rhs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good; def etaExpand
could now take a owner: Symbol
parameter instead of the full typer: Typer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a commit with that refactoring.
69273ab
to
a9d412f
Compare
tree.changeOwner(typer.context.owner -> valSym) | ||
} | ||
valSym.setInfo(rhs.tpe) | ||
ValDef(valSym, rhs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a commit with that refactoring.
The fix for scala/bug#6274 did this selectively when function symbols were introduced, but we really ought to insert the eta$n temp vals into the owner chain of all lifted expressions.
Based on review by lrytz
a9d412f
to
05555e8
Compare
assuming not critical for M5. retarget if you disagree |
I think this one is ready to go, actually. If the resetAttrs interaction proves problematic, we can refine. |
The fix for scala/bug#6274 did this selectively when function symbols
were introduced, but we really ought to insert the eta$n temp vals into
the owner chain of all lifted expressions.