Skip to content

Conversation

@sujeenoh-dev
Copy link
Contributor

Closes #24 issue.

nvollmar
nvollmar previously approved these changes Jun 2, 2025
Copy link
Member

@nvollmar nvollmar left a comment

Choose a reason for hiding this comment

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

lgtm - thanks for bringing up this issue.

A concern is, that Users might not be aware of the initialization being done again after deserialization. This solution is reasonable if we want to support lazy val serialization, but maybe we should add a hint in the README how lazy vals are serialized in Scala 3 and that it might be re-evaluated on the deserialized object.
(Another option would be to not support lazy val serialization on Scala 3)

@nvollmar nvollmar requested a review from danischroeter June 2, 2025 05:42
@ghostdogpr
Copy link

Note that the proposed approach here is consistent with how Scala 3 handled it for Java serialization (since there was the same problem): scala/scala3#21243

I think updating the README sounds good 👍

@sujeenoh-dev
Copy link
Contributor Author

Thank you for the feedback! I'll update the PR and add a note about this behavior to the README.

@nvollmar
Copy link
Member

nvollmar commented Jun 2, 2025

@ghostdogpr Thanks for the reference, handling it the same way as Java serialization indeed makes sense.

@sujeenoh-dev
Copy link
Contributor Author

sujeenoh-dev commented Jun 4, 2025

If the updated description looks good, Please merge the PR. 🙏

Copy link
Member

@danischroeter danischroeter left a comment

Choose a reason for hiding this comment

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

nice! thx a lot

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.

Fix Scala3 lazy val serialization

4 participants