alistairv
❔ Pattern matching on multiple cases with the same-typed members
Hello, I am currently stuck with code like this:
where
Bar1 : Bar, Bar2: Bar, ...
and the type of Prop1, Prop2, ...
is the same. Since Bar
is not my type, I cannot simply modify it to suit me better.
My question: Is there a way to handle this more elegantly inside the method (aside from extracting a local function)? I am thinking of some syntax like
but unfortunately this is invalid syntax. Same holds for
12 replies