-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Do not create companions that will be dropped later. #1117
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
Conversation
@odersky please review. |
7471f09
to
1129f90
Compare
/rebuild |
Single test failed: TASTY pickling with [error] java.lang.OutOfMemoryError: GC overhead limit exceeded Fix passes all the test on my machine and is ready for review. |
@@ -46,6 +47,12 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer { | |||
* before this phase starts processing same tree */ | |||
override def runsAfter = Set(classOf[Mixin]) | |||
|
|||
def isCompanionNeeded(cls: ClassSymbol)(implicit ctx: Context): Boolean = { | |||
println("testing " + cls) |
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 assume you'll drop the println before merging?
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.
Thanks for noticing.
1129f90
to
e5ca61a
Compare
I think DropEmptyCompanions.scala should be deleted too, otherwise it's easy to think that it's still in use. |
@smarter There are actually some other phases as well which are still in transfrom even though they are not used. We could get rid of them all maybe, or rename to .scala.disabled (?) |
fbad29b
to
7f00598
Compare
Fix blocker bug reported in scala#1114 I dislike this fix as now phase needs to know in advance if it will ever need a companion for the class. On the bright side, this change makes it clear which phases need companions
6db2ef6
to
0f4d74d
Compare
rebased. |
LGTM |
Do not create companions that will be dropped later.
Fix blocker bug reported in #1114
I dislike this fix as now phase needs to know in advance
if it will ever need a companion for the class.
On the bright side, this change makes it clear
which phases need companions