Skip to main content

RCS1003: Add braces to if-else (when expression spans over multiple lines)

Properties​

PropertyValue
Default SeverityInfo
Minimum language version-

Examples​

Example #1​

diagnostic.cs
if (condition)
WhenTrue(
x,
y);
else
WhenFalse(
x,
y);
fix.cs
if (condition)
{
WhenTrue(
x,
y);
}
else
{
WhenFalse(
x,
y);
}

Applies to​