Add support for constant pattern matching assignments #4802
Unanswered
mburbea
asked this question in
Language Ideas
Replies: 2 comments
-
Is that |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you want: if (span.IndexOf(pattern) is not -1 and var x)
{
Console.WriteLine(x);
} |
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.
-
Consider this snippet:
Consider the following snippet::
And the seemingly similar code:
I propose we allow variable assignment after any pattern so that this code in theory could be rewritten to do something like:
Beta Was this translation helpful? Give feedback.
All reactions