JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

Code inspection: Assignment in conditional expression

Last modified: 08 April 2024

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

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