-
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
Unpickle arguments of parent constructors in Templates lazily #16688
Conversation
def unforced: LazyTreeList[T] = preBody | ||
|
||
protected def force(x: List[Tree[T @uncheckedVariance]]): Unit = preBody = x |
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.
These methods from WithLazyField
won't cause myParentsOrDerived
to be forced which may break various tree traversals where we call WithLazyField#forceIfLazy
. It seems that WithLazyField
needs to be generalized to support multiple lazy fields.
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.
In fact they do force myParentsOrDerived
by the logic in Template
but that logic is obscure. I cleaned it up.
Since this should get into 3,0 a review is time-critical. |
Avoid reading the arguments of parent constructors unless someone forces them. We don't need them to determine the parent types of the class to which the template belongs. This makes TreeUnpickler as lazy as Namer in this respect and therefore avoids CyclicReferences during unpickling. Fixes scala#16673
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 fine.
(Also looks like one more reason to store parent types in TEMPLATE independently of super constructor calls. ;) )
Avoid reading the arguments of parent constructors unless someone forces them. We don't need them to determine the parent types of the class to which the template belongs. This makes TreeUnpickler as lazy as Namer in this respect and therefore avoids CyclicReferences during unpickling.
Fixes #16673