-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Singleton enum cases (marked Serializable
) are incorrectly serialized
#9179
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
Labels
Comments
I think we should try to generate readObject and writeObject methods. It's natural for enumerations to be serializable. |
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 10, 2020
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 10, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 11, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 11, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 11, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 11, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 11, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 11, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 13, 2020
…rialization proxy
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 17, 2020
…rialization proxy
bishabosha
added a commit
that referenced
this issue
Aug 17, 2020
fix #9179: ensure enum values are singleton with serialisation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimized code
Running twice with 0.25.0-RC1:
Output
On second execution:
Expectation
I expected
a == A.B
because it is markedSerializable
by default.I think there are two options:
Enum
(with singleton cases) extendingSerializable
, which seems to go against Mirror.Product is available for enum values that are not subtypes of Product #9011, orwriteObject()
andreadObject()
when desugaring enum, though I'm not sure if it's possible and worthwhile.The text was updated successfully, but these errors were encountered: