[Issue 1560] Skip switch warning for complete enum set

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 10 12:53:29 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1560





------- Comment #2 from david at acz.org  2007-10-10 14:53 -------
Sorry about the confusion on the line numbers.  I was running it as a shell
script, thus it had two extra lines above the code shown.

I hadn't considered an enum instance containing an invalid value, though to my
knowledge you have to intentionally do that with a cast.

Ignoring the issue of default, it would be still helpful to know at compile
time if all enum cases are handled, but perhaps not in all cases.  How could
this be checked cleanly?

A similar case is when maintaining a parallel array:

char[][] name = [T.RED : "red", T.BLUE : "blue"];

How can we determine that GREEN is missing at compile time?


-- 



More information about the Digitalmars-d-bugs mailing list