This issue was previously reported in the old Roslyn forums.
``` C#
var i = 0;
switch (i)
{
case 0:
Console.WriteLine('0');
case 1:
Console.WriteLine('1');
case 2:
break;
}
```
The code above will compile in both scripting and interactive mode.
In interactive mode, the code will compile even if the break statement is omitted.
_Edited Code for clarity_
Fall through switch is insanely useful for high performance code.
@redknightlois You can still fall through in C#, you just have to do it explicitly. The syntax looks like this:
@sharwell Nice, didn't know that.
Would that emit a jump statement if the behavior would be fall through? Or better would the JIT find out and do not emit the jump at all?
@redknightlois If I'm not mistaken, the C# compiler will remove unnecessary branch instructions between cases when optimization is enabled (but not when optimization is disabled because it would negatively impact the debugging experience).