https://issues.dlang.org/show_bug.cgi?id=24585
Issue ID: 24585
Summary: Allow switch with multiple arguments
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Allow `switch` statements to have more than one argument: `switch (x, y)`.
Case labels then take the same number of arguments: `case (0, 0):`
The parentheses after `case` are then required.
A case label matches if it would match components individually.
While this should work for all types for which `switch` works, if the type of
the components’ sizes adds up to ≤ 64 bit, arguments can be connected into an
`ulong` (or smaller) and checked together.
--