You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To clarify, this is just another "recursive pattern", once those are introduced to the language you can imagine more usages from combining various kinds of patterns.
Moved from: #16742 (comment)
I propose to add a pattern operator to negate the effect of another pattern,
not-pattern:
not
patternA "negative pattern" could be applied to an arbitrary pattern and reverse the failure path.
Examples:
It could be even nested in recursive patterns as well,
This would be consistent with other proposed pattern operators like #6235.
Note that definitive assignment rules are reversed, for example,
This also eliminates the need to parenthesize the
is
expression in case you want to negate the result.The text was updated successfully, but these errors were encountered: