Pattern matching: override deconstruct #2852
Unanswered
akiraKido
asked this question in
Language Ideas
Replies: 1 comment
-
Deconstruct can only be overloaded by arity of the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For pattern matching, I'd like to deconstruct a certain struct I made as follows:
so that I would be able to do something like this:
This currently doesn't compile, saying that the deconstruction is ambiguous, despite explicitly declaring their types.
This works:
but the
_
seems verbose to me.Beta Was this translation helpful? Give feedback.
All reactions