ExhaustiveMatching icon indicating copy to clipboard operation
ExhaustiveMatching copied to clipboard

Support logical pattern matching for enums

Open leus opened this issue 1 month ago • 0 comments

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)
}

leus avatar May 14 '24 14:05 leus