logoalt Hacker News

high_na_euv01/16/20262 repliesview on HN

C# doesnt have exhaustive switch over enums.

It needs to get "closed enum" lang. feature.


Replies

torginus01/16/2026

Exhaustive enums (or type switches) are not a requirement, and are infact harmful - imagine if they add a new kind of syntax node to the language, now your analyzer no longer compiles unless you add a default case - which is very easy to add in C# as well.

show 1 reply
neonsunset01/16/2026

[dead]