JetBrains Rider
 
2021.3
Get JetBrains Rider
You are viewing the documentation for an earlier version of JetBrains Rider.

Code Inspection: Redundant empty switch section

Last modified: 07 April 2022

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.

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