Switch-case made less buggy, now with PATCH!

Ellery Newcomer ellery-newcomer at utulsa.edu
Sun Nov 22 11:38:41 PST 2009


On 11/20/2009 07:51 PM, Chad J wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=3536
>
> So Walter, with this you can keep your beloved fall-through.
> Now can the rest of us be spared the nasty fall-through bugs, please
> please please??
>
> Also, about assert(0)... I'd be happy to change what I did if Walter and
> associates feel that adding assert(0) to the list is worth its minor
> complications.
>
> (Sorry I don't have a patch for properties, but that one's harder.)
>
> - Chad

<patch critic>

switch(i){
  case 1:       //this should not yield an error. change it.
  case 2:
    blah;
    break;
}

switch(i){
  case 1:
    {
      break;
    }           //this should not yield an error. change it.
}

switch(i){
   default:
     blah;      //this should yield an error. change it.
   case 0:
     case0onlyblah;
}


</patch critic>



More information about the Digitalmars-d mailing list