News for hackers. Stuff that matters.
Re:When are enums not a code smell? by aardvark179 on Monday November 22, 2021 @11:45AM (#29308428)
Switch statements are not required to be exhaustive, but switch expressions are. I’d have to check but I think it was found that changing the exhaustiveness requirement would break too much source code. The compiler will still insert some some sort of default case because somebody might add to the enumerator, and it might be in a separate compilation unit.

There are no comments on this comment yet.