RedundantIfForBooleanCheck makes invalid suggestion #676
Labels
bug
Something isn't working
false-positive
A lint triggers on something that is correct.
high-priority
Issues that should be solved as soon as possible
Summary
The two expressions are equivalent, except for the case where
ìsSafe = true, isEdgeLegal = true, isEdgeSafe = false
.Lint Name
RedundantIfForBooleanCheck
Reproducer
Given the above code, it suggests:
This is wrong.
The assumption is that the boolean
isSafe
isfalse
when the|| isEdgeLegal
is evaluated. This is not the case, therefore an!isSafe &&
must be added to the suggestion:The text was updated successfully, but these errors were encountered: