Thank you for dropping silent fall-through on switch-case.

Chad Joan chadjoan at gmail.com
Sun Jul 14 20:31:10 PDT 2013


I was porting some C code to D the other day.  It had a switch-case 
statement in it, and to my surprise the compiler complained about a case 
that could fall through unintentionally.  Lo and behold, it was a bug! 
I was so happy to see this happen.  It really made my day.

So I wanted to drop by and say "thank you".  Thank you Walter for 
putting this in, and thank you whoever convinced Walter to accept that 
patch/pull ;)

It's a major source of bugs defeated, and now I don't have to use long 
chains of if-else-if-else statements every time I want to do some n-ary 
choice in D (which is a habit I've picked up in languages with the 
switch-case pitfall).  Awesome!



More information about the Digitalmars-d mailing list