Skip to content

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