Skip to content
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

Add isSingletonCasesEnum flag #457

Open
wants to merge 13 commits into
base: scala3-v2
Choose a base branch
from

Conversation

sake92
Copy link

@sake92 sake92 commented Feb 6, 2023

It is useful to disambiguate between "singleton cases"/simple enums and ADTs.

My concrete use case was JSON serialization:

  • simple enums get written as simple strings
  • ADTs get written as objects with @type field, and other fields if they have them

Implementation-wise, the official docs say that only "singleton cases" enums will have a values method.

@adamw
Copy link
Member

adamw commented Feb 6, 2023

Thanks - this isn't binary-compatible, but there's a scala3-v2 branch that can accept these changes :)

@sake92 sake92 changed the base branch from scala3 to scala3-v2 February 6, 2023 16:09
@sake92
Copy link
Author

sake92 commented Feb 6, 2023

Thanks @adamw !
Do those artifacts get published too?

@adamw
Copy link
Member

adamw commented Feb 6, 2023

Not yet - but we'll get there eventually :)

@sake92
Copy link
Author

sake92 commented Oct 27, 2024

Could this be merged now?

@adamw
Copy link
Member

adamw commented Oct 30, 2024

@sake92 see #552

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.

2 participants