Skip to main content

RCS1031: Remove unnecessary braces in switch section

Properties​

PropertyValue
Default SeverityHidden
Minimum language version-

Examples​

Example #1​

diagnostic.cs
switch (x)
{
case "a":
{
M();
break;
}
case "b":
break;
}
fix.cs
switch (x)
{
case "a":
M();
break;

case "b":
break;
}

Applies to​