Fetching contributors…
Cannot retrieve contributors at this time
38 lines (28 sloc) 787 Bytes

RCS1173: Use coalesce expression instead of if

Property Value
Id RCS1173
Category Simplification
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer -


Code with Diagnostic

if (x != null) // RCS1173
    z = x;
    z = y;

Code with Fix

z = x ?? y;

See Also

(Generated with DotMarkdown)