Object equality comparison for disjunctive patterns #8029
Unanswered
CypherPotato
asked this question in
Language Ideas
Replies: 2 comments 2 replies
-
I don't believe the |
Beta Was this translation helpful? Give feedback.
2 replies
-
It's basically distributive property on binaryOp over patternOp:
|
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.
Uh oh!
There was an error while loading. Please reload this page.
-
As discussed in #8028 (reply in thread), we can check if a value is part of the set with the
is
operator:but this expression does not work for non-constant values. The proposal is to check whether the value is still part of a set, through its
Equals
method or==
operator, for each embedded value, such as:Which would be lowered to:
or even
Something like this would be more syntax sugar, but it would reduce the amount of code needed to achieve the given goal.
Beta Was this translation helpful? Give feedback.
All reactions