Closed
Description
invariant_booleans fired when im using if statement with or operation then using the same statement with and condition
To Reproduce
const a = true;
const b = false;
var text = "";
if (a || b) {
text += "success! also : ";
if (a && b) {
text += "both value is true";
} else if (a) {
text += "only a is true";
} else {
text += "only b is true";
}
} else {
text += "error!";
}
print(text);
a && b
is detected as invariant_booleans
Expected behavior
invariant_booleans should not be fired, because the condition is not redundant with previous condition
Additional context
when the inner statement is only if, without else / else if, invariant_booleans isnt fired
const a = true;
const b = false;
var text = "";
if (a || b) {
text += "success! also : ";
if (a && b) {
text += "both value is true";
}
} else {
text += "error!";
}
print(text);