Skip to content

Pitch for extensible enums #2679

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

Merged
merged 19 commits into from
May 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address adding associated values
  • Loading branch information
FranzBusch committed Feb 5, 2025
commit b367bb9fd6c1ea2c3833b9ba119903ecac5800c7
7 changes: 7 additions & 0 deletions proposals/NNNN-extensible-enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ Enums can be used for errors. Catching and pattern matching enums could add
support for an `@unknown catch` to make pattern matching of typed throws align
with `switch` pattern matching.

### Allow adding additional associated values

Adding additional associated values to an enum can also be seen as extending it
and we agree that this is interesting to explore in the future. However, this
proposal focuses on solving the primary problem of the unusability of public
enumerations in non-resilient modules.

## Alternatives considered

### Only provide the `@extensible` annotation
Expand Down