Skip to content

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

Merged
merged 3 commits into from
Feb 20, 2016

Conversation

DarkDimius
Copy link
Contributor

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

@DarkDimius
Copy link
Contributor Author

@odersky please review.

@DarkDimius
Copy link
Contributor Author

/rebuild

@DarkDimius
Copy link
Contributor Author

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for noticing.

@DarkDimius DarkDimius force-pushed the dont-create-companions branch from 1129f90 to e5ca61a Compare February 20, 2016 15:03
@smarter
Copy link
Member

smarter commented Feb 20, 2016

I think DropEmptyCompanions.scala should be deleted too, otherwise it's easy to think that it's still in use.

@odersky
Copy link
Contributor

odersky commented Feb 20, 2016

@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 (?)

@DarkDimius DarkDimius force-pushed the dont-create-companions branch from fbad29b to 7f00598 Compare February 20, 2016 16:32
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
@DarkDimius DarkDimius force-pushed the dont-create-companions branch from 6db2ef6 to 0f4d74d Compare February 20, 2016 16:42
@DarkDimius
Copy link
Contributor Author

rebased.

@odersky
Copy link
Contributor

odersky commented Feb 20, 2016

LGTM

odersky added a commit that referenced this pull request Feb 20, 2016
Do not create companions that will be dropped later.
@odersky odersky merged commit 11bd355 into scala:master Feb 20, 2016
@allanrenucci allanrenucci deleted the dont-create-companions branch December 14, 2017 16:58
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.

4 participants