Skip to content

Conversation

@ThijsBroersen
Copy link

@ThijsBroersen ThijsBroersen commented Sep 5, 2025

Initial draft of string based literal type union support.

@lihaoyi
Copy link
Member

lihaoyi commented Sep 10, 2025

I think the approach looks fine as a first draft, but my concern is how it scales to broader usages of union types? Apart from unions of literal String types, can we also support unions of different primitives (e.g. String | Int | Boolean), or unions of different distinct case classes or objects?

I mainly to make sure there's some coherent approach that we can document and users can understand, and that whatever we implement now doesn't get in the way of implementing other union types in future since we'll be locking in the public API

@ThijsBroersen
Copy link
Author

See #682 for my idea on how this could be done.

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