ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Code Inspection: Assignment in conditional expression

Last modified: 21 July 2022

Comparison operators in a conditional expression are used much more often than assignment operators.

ReSharper assumes that you probably intended to test the identity of the operands, and suggests that you replace the assignment operator = with the equality operator ==.