dmd 1.046 and 2.031 releases

Don nospam at nospam.com
Tue Jul 7 07:11:38 PDT 2009


Walter Bright wrote:
> Something for everyone here.
> 
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.046.zip
> 
> 
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.031.zip

Why is 'final switch' required? Another possible way of dealing with the 
same issue would be:

switch(e) {
case E.A: blah; break;
case E.B: blah; break;
...
default: assert(0);
}

Ie, if switch is over an enum type, and the 'default' clause consists 
only of assert(0), the compiler could generate a warning if some of the 
possible enum values never appear in a case statement.

It's not quite the same as 'final switch', but I think it captures most 
of the use cases.


More information about the Digitalmars-d-announce mailing list