-
Notifications
You must be signed in to change notification settings - Fork 7
Description
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.