About switch case statements...

bearophile bearophileHUGS at lycos.com
Mon Nov 16 10:02:58 PST 2009


Bill Baxter:

> Could this get into difficult-to-verify territory?  And therefore be
> difficult to implement?
> It looks like the exact same problem as enforcing that all code paths
> return a value, which is something I think D doesn't currently enforce
> because it's too hard.   So you run into Walter's dislike for
> errors/warnings that are incorrect because the compiler is too stupid.

If someone writes a switch case so complex that the compiler isn't able to understand if it's a fall-through or not, then that's a sign that the code needs to be improved/simplified :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list