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

feat: implement Scala 3 Constant and Union support for string-based literals as enums #1125

Conversation

ThijsBroersen
Copy link
Contributor

This PR implements support for string-based literal types. Single-value or Union-based.

Example:

case class Foo(aOrB: "A" | "B", optA: Option["A"]) derives JsonCodec

Foo("A", Some("A")).toJson

"""{"aOrB": "A", "optA": "A"}""".fromJson[Foo]

@ThijsBroersen ThijsBroersen requested a review from a team as a code owner June 13, 2024 17:53
@ThijsBroersen
Copy link
Contributor Author

I have a commit with doc changes ready but mdoc is not configured for Scala 3 examples... Can we change that?

@ThijsBroersen ThijsBroersen marked this pull request as draft June 13, 2024 18:27
@ThijsBroersen ThijsBroersen marked this pull request as ready for review June 13, 2024 21:46
@jdegoes jdegoes merged commit 608bb6e into zio:series/2.x Jun 13, 2024
28 checks passed
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