This project is read-only.
1
Vote

Code should not be considered unreachable if it follows a switch statement missing case breaks

description

Code:
switch (1) {
    case 1:
}
int i;
The case label correctly gives an error for the missing break.
However, the int i; statement then gives an incorrect Unreachable Code warning.

comments

PauloMorgado wrote Oct 29, 2014 at 1:12 AM

Confirmed!

PauloMorgado wrote Oct 29, 2014 at 1:14 AM

Also confirmed for C#5.0!

theoy wrote Oct 29, 2014 at 6:17 AM

Nice catch! I think this would be a nice improvement to the error scenario of a missing case break. As Paulo confirmed that this behavior is already existing, we'll probably prioritize other issues first before considering taking this on.

nmgafter wrote Feb 18, 2015 at 12:26 AM

Bug has been moved to https://github.com/dotnet/roslyn/issues/612

Please go there for any further updates.

nmgafter wrote Apr 29, 2015 at 11:40 PM

This has been fixed.