ClosedTypeHierarchyDiagnosticSuppressor icon indicating copy to clipboard operation
ClosedTypeHierarchyDiagnosticSuppressor copied to clipboard

Add support for destructured records

Open rfvgyhn opened this issue 1 year ago • 2 comments

This PR adds support for patterns that destructure a record with positional params.

abstract record Root
{
    Root() {}
    public sealed record Leaf1(int Value) : Root {}
    public sealed record Leaf2 : Root {}
}


return root switch
{
    Root.Leaf1(var v) => 0,
    Root.Leaf2 => 1,
};

I wasn't sure how to create a unit test with a specific editor config so I added a new constructor param to the suppressors. Let me know if that's no good.

rfvgyhn avatar Dec 07 '23 03:12 rfvgyhn

I have seen the PR but have not had time yet to look at it, sorry.

shuebner avatar Dec 18 '23 17:12 shuebner

Ran into this as well, would be nice to have this in a new version.

rutgersc avatar Jun 05 '24 13:06 rutgersc

closing in favor of #10

shuebner avatar Oct 10 '24 04:10 shuebner