Skip to main content

RCS1006: Merge 'else' with nested 'if'

Properties​

PropertyValue
Default SeverityHidden
Minimum language version-

Examples​

Example #1​

diagnostic.cs
if (condition1)
{
Foo1();
}
else
{
if (condition2)
{
Foo2();
}
}
fix.cs
if (condition1)
{
Foo1();
}
else if (condition2)
{
Foo2();
}

Applies to​