-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Non-deterministic codegen for Option deserialization #1146
Comments
@hubertp Hi, Hubert! Thanks for trying and sending your feedback! Generated codecs are always the same for the same jsoniter-scala version, derivation configuration and a way of injection of custom codecs using implicit I've tried to compile Do you have any isolated example to see your expectations and results clearly? From your PR I learned that jsoniter-scala docs should be improved to clearly state that |
Thanks for the info. Moving serde logic to a separate module appears to have solved the problem. Probably a combination of incremental compilation + macros led to this non-determinism. |
I'm trying to replace Jackson serialization with jsoniter and encountering some issues with serialization.
The problems appears to be during deserialization of
Option
values in case classes.Macro for writing
foo: Option[String]
field will always generate something similar to(decompiled code, for reference only)
While reading will generate either 1:
or 2:
where
d99
is roughly generated asObviously, given the serialization code, I would expect only option 1, which is generated in the macro. But sometimes it generates deserialization for JSON value in 2 and complains with the usual
where
parentType: Option[String]
.PR demonstrating the issue enso-org/enso#10035 in a target project. Anyone encountered this as well?
The text was updated successfully, but these errors were encountered: