-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Inline unapply
s in the inlining phase
#19382
Inline unapply
s in the inlining phase
#19382
Conversation
Won't that cause the transparent inline call to also be inlined later, at the inlining phase? Outside of the one deleted here, I can't see any other reference to |
b757481
to
729327b
Compare
Yes. I changed this to keep inlining the transparent ones before pickling. |
We should only merge this if it is also backported to |
729327b
to
75a9813
Compare
case tree: UnApply => | ||
tree match | ||
case tree1: UnApply if Inlines.needsInlining(tree1) => | ||
super.transform(cpy.UnApply(tree1)(fun = Inlines.inlinedUnapplyFun(tree1.fun))) |
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.
This implementation changed after I rebased.
@@ -1937,9 +1937,6 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer | |||
if (bounds != null) sym.info = bounds | |||
} | |||
b | |||
case t: UnApply if t.symbol.is(Inline) => | |||
assert(!t.symbol.is(Transparent)) | |||
cpy.UnApply(t)(fun = Inlines.inlinedUnapplyFun(t.fun)) // TODO inline these in the inlining phase (see #19382) |
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.
This was deleted after I rebased
75a9813
to
fee0287
Compare
fee0287
to
d6a621c
Compare
It has been decided to be included in the 3.5.0 release. |
case tree: UnApply => | ||
tree match | ||
case tree1: UnApply if Inlines.needsInlining(tree1) => | ||
super.transform(cpy.UnApply(tree1)(fun = Inlines.inlinedUnapplyFun(tree1.fun))) | ||
case tree1 => super.transform(tree1) |
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.
case tree: UnApply => | |
tree match | |
case tree1: UnApply if Inlines.needsInlining(tree1) => | |
super.transform(cpy.UnApply(tree1)(fun = Inlines.inlinedUnapplyFun(tree1.fun))) | |
case tree1 => super.transform(tree1) | |
case tree: UnApply if Inlines.needsInlining(tree) => | |
super.transform(cpy.UnApply(tree)(fun = Inlines.inlinedUnapplyFun(tree.fun))) |
Just a NIT/question. Would this work? I see there is a case that should go through super.transform(tree) for non inline Unapply trees later as well
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.
I probably wanted to avoid calling needsInlining
twice. I can refactor it to make it more concise.
These currently got inlined while typing. Therefore they used to generate code that should not be pickled.
d6a621c
to
804294c
Compare
These currently got inlined while typing. Therefore they used to generate code that should not be pickled. The non-transparent inline methods should be inlined in the inlining phase.
This was found while working on #19380.