ExhaustiveMatching
ExhaustiveMatching copied to clipboard
Support logical pattern matching for enums
Using or
in enum matches currently displays error EM0001 in the IDE:
sortOrder switch {
SomeEnum.Unknown or
SomeEnum.NewestFirst => someValue,
SomeEnum.OldestFirst => anotherValue,
=> throw ExhaustiveMatch.Failed(sortOrder)
}