Skip to content

C#: Data flow for positional patterns. - #22689

Draft
michaelnebel wants to merge 5 commits into
github:mainfrom
michaelnebel:csharp/positionalpatternflow
Draft

michaelnebel wants to merge 5 commits into
github:mainfrom
michaelnebel:csharp/positionalpatternflow

Conversation

@michaelnebel

@michaelnebel michaelnebel commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

In this PR we add data flow support via positional patterns. That is,

var x = (1, (2, 3), 4);
switch (x)
{
    case (var a1, (var b1, var c1), _):
        Sink(a1);        // has value flow 1
        Sink(c1);        // has value flow 3
        Sink(b1);       // has value flow 2.
        break;
}

Note, that positional patterns are similar to tuple patterns (var (x, y)), but they haven't been handled in the data flow library before now.

@michaelnebel michaelnebel changed the title Csharp/positionalpatternflow C#: Data flow for positional patterns. Sep 29, 2026
@michaelnebel
michaelnebel force-pushed the csharp/positionalpatternflow branch from 84d670d to f059beb Compare September 30, 2026 12:22
@michaelnebel
michaelnebel force-pushed the csharp/positionalpatternflow branch from f059beb to f3eaab2 Compare October 2, 2026 08:17
@michaelnebel
michaelnebel force-pushed the csharp/positionalpatternflow branch from f3eaab2 to ae1c4ad Compare October 2, 2026 09:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant