Closed
Description
Allowing |
to be used within a sub-pattern would allow some match expressions on tuples and structs to be written much more clearly and concisely.
For example, the following match expression:
match (x, y) {
(A|B, C|D) => 0,
_ => 1
}
would be equivalent to this expanded version:
match (x, y) {
(A, C) => 0,
(A, D) => 0,
(B, C) => 0,
(B, D) => 0,
_ => 1
}
Metadata
Metadata
Assignees
Labels
No labels