switch()

Marc Schütz" <schuetzm at gmx.net> Marc Schütz" <schuetzm at gmx.net>
Wed Feb 19 04:02:11 PST 2014


On Tuesday, 18 February 2014 at 15:45:31 UTC, Ary Borenszweig 
wrote:
> Exactly. Programmers will just put "default: break" because of 
> this annoyance without thinking too much if it should be this 
> or assert(0).
>
> I think that "final switch" should have the function of 
> checking that you covered all cases, be it with a default case 
> or not.

A better warning/error message may help here. Please have a look 
at this PR:

https://github.com/D-Programming-Language/dmd/pull/3287


More information about the Digitalmars-d mailing list