I have a switch statement that check a tuple. One of the part of the tuple is an enum. How can I match multiple enum cases inside that tuple?
I've tried several things, which all lead to compiler errors. Here's one attempt:
switch (enumValue, myArray.isEmpty)
{
case (.one, true): // Fine.
...
case ((.one, .two), false): // Error: Tuple pattern cannot match values of the non-tuple type 'MyEnum'
...
}
Is there a way to do this?