shuebner/ClosedTypeHierarchyDiagnosticSuppressor
View on GitHub ↗ ★ 55 C#
Suppresses exhaustiveness warnings for switching (switch statement or expression) on closed type hierarchies
3 mentions on Hacker News by 3 people: 1 story, 2 comments · first 2023-01-07 · latest 2024-08-07
20082026
-
I'm currently using nested records with a private constructor in combination with the nuget package https://github.com/shuebner/ClosedTypeHierarchyDiagnosticSup... to make sure the switch types do not require a `_` case. This is…
comment by ctenb · 2024-08-07 · in Official proposal for Type Unions in C# -
It's not the best solution, but an analyzer like [0] covers most of the cases for reference types. For enums and struct DUs in general we'll have to wait for language (or even runtime) support. [0] https://github.com/shuebner/ClosedTypeHier…
comment by orthoxerox · 2024-04-30 · in Borgo is a statically typed language that compiles to Go -
▲ 1
Exhaustiveness check for Discriminated Unions in C#story by mvac · 2023-01-07 · 0 comments