Fetching contributors…
Cannot retrieve contributors at this time
31 lines (21 sloc) 780 Bytes

RCS1051: Parenthesize condition in conditional expression

Property Value
Id RCS1051
Category Style
Default Severity Info
Enabled by Default -
Supports Fade-Out -
Supports Fade-Out Analyzer -


Code with Diagnostic

object x = condition ? WhenTrue() : WhenFalse(); // RCS1051

Code with Fix

object x = (condition) ? WhenTrue() : WhenFalse();

See Also

(Generated with DotMarkdown)