Skip to main content

RCS1103: Convert 'if' to assignment

Properties​

PropertyValue
Default SeverityInfo
Minimum language version-

Examples​

Example #1​

diagnostic.cs
if (condition)
{
f = true;
}
else
{
f = false;
}
fix.cs
f = condition;

Example #2​

diagnostic.cs
if (x != null)
{
y = x;
}
else
{
y = null;
}
fix.cs
y = x;

Applies to​