Skip to content

Support for switch patterns #54

@thinker227

Description

@thinker227

Background: I am writing a compiler in C#, and as such this project seemed like a literal gold mine since I'm using record inheritance for all my AST and other tree nodes. However, I was somewhat disappointed to see that the analyzer only seems to support type patterns, eg. case T x:/T x => and not complex patterns like deconstruction or or patterns.

This perhaps seems like an obvious suggestion, but it would be immensely useful to emulate the exhaustiveness checking which Roslyn performs but with the added constraint that the full set of possible types is known. I doubt the internal mechanisms Roslyn uses to perform exhaustiveness analysis is publicly exposed to the API, so I'm unsure of whether it'd be possible to leech off of the work Roslyn already does or whether the analyzer would have to implement almost the entirety of the functionality by itself. Either way, this would be immensely useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions