Switch statement

Nov 25, 2010 at 8:51 AM

Hi All,

I'm having some issues with switch statements, the following returns 0, where I would have expected a 2 , if input = 'b', it returns 2. So it seems like an issue with the case fall through

var result = 0;
var input = 'a';
switch(input)
{
         case 'a':
         case 'b':
             result = 2;
             break;
          case 'c':
              result = 3;
             break;
          case 'd':
               result = 4;
               break;
          default:
               break;

}
return result;

Coordinator
Nov 25, 2010 at 4:36 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Nov 25, 2010 at 4:37 PM

Fixed. Thanks for reporting it.

Next time don't hesitate and file a bug directly ;)