You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a rule to prevent checking boolean explicit on true or false #2352
I'm OK with this. It wouldn't be high on my list to implement, but if someone wants to take a shot at it, it should not be that hard to implement it (and the code fix).
If a is nullable then the meaning of == changes. I agree that this is only suitable is a has type bool, or if there is an implicit conversion operator from a to bool (as opposed to a user-defined operator== for a with bool).
Activity
vweijsters commentedon May 12, 2017
I'm OK with this. It wouldn't be high on my list to implement, but if someone wants to take a shot at it, it should not be that hard to implement it (and the code fix).
pdelvo commentedon Aug 15, 2017
Do we only want this if a is Boolean? What if a is a Nullable? What if there is an implicit conversion from the type of a to Boolean?
Personally I would only do this if a is Boolean.
sharwell commentedon Aug 15, 2017
If
ais nullable then the meaning of==changes. I agree that this is only suitable isahas typebool, or if there is an implicit conversion operator fromatobool(as opposed to a user-definedoperator==forawithbool).