14 ms·
C# doesnt have exhaustive switch over enums. It needs to get "closed enum" lang. feature.
by high_na_euv 9mo ago
C# doesnt have exhaustive switch over enums.
It needs to get "closed enum" lang. feature.
- torginus 9mo agoExhaustive 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.
- high_na_euv 9mo agoUnless you add default... or handle such case, as expected. Ofc you can use this feature wrong and abuse default case, but in general this is very good since it prevents you about missing places to add handling and screams at you at comp time instead of runtimr
- neonsunset 9mo ago[dead]