#How to ignore some Enumeration values in `switch`

1 messages · Page 1 of 1 (latest)

tawny birch
#

I'm switching over a tagged union, and only want to handle some variants, with a fallback.
If I just don't handle them, I get the expected unhandled enumeration value: ..., and if I try to use _ => fallback I get '_' prong only allowed when switching on non-exhaustive enums
What am I supposed to do in this case?

amber swallow
#

you'd use else :)

#
switch (some_enum_val) {
  .bruh => {...},
  else => {...},
}