values
is not generated for enums with open case
#21955
goshacodes
started this conversation in
Feature Requests
Replies: 1 comment
-
The original reasoning was that values is exhaustive rather than "whatever values are defined" I'm sure we can make it opt in, but there are also I guess library solutions to this if we don't make it configurable |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Compiler version
3.3.4
Problem
Hi!
A common pattern when creating enums is to define
value
field and leave one case open.When defining such patterns you still need basic
values
. This is one of greatest features ofenumeratum
and it is missing in stdlib.I think there was a reason why this was done like this, but it would be great to somehow support it out of the box.
Other thing to improve is to make
valueOf
bounded to this customvalue
for basic cases.Is this possible?
Minimized code
Output
Expectation
Beta Was this translation helpful? Give feedback.
All reactions