ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code Inspection: Redundant empty switch section

Last modified: 08 March 2021

In C#, you do not have to include the default section in switch statements. If no case sections were executed, and there is no default section specified, control is transferred outside a switch statement.

ReSharper considers the empty default branch redundant and suggests removing it to improve the code readability.