DynamicExpresso icon indicating copy to clipboard operation
DynamicExpresso copied to clipboard

Pattern matching expressions

Open ealeykin opened this issue 3 years ago • 1 comments

It would great to support pattern matching, not sure how complex the implementation is, but for example having the following condition:

value == "match" || value == null

is much more readable with cs pattern matching

value is "match" or null

ealeykin avatar Dec 08 '21 22:12 ealeykin

Relevant documentation : https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/patterns Relevant specifications : https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/expressions#121212-the-is-operator

We can probably focus on the is operator, and ignore the switch statement and expression.

metoule avatar Dec 09 '21 08:12 metoule