bool_comparison
Finds comparing a bool with true or false.
Category complexity, warn by default.
#import "Basic";
main :: () {
ready := true;
if ready == true print("ready\n");
}warning[bool_comparison]: comparing a bool with `true`: `ready == true`
--> example.jai:6:8
|
6 | if ready == true print("ready\n");
| ^^^^^^^^^^^^^
|
help: write `ready`
|
6 ~ if ready print("ready\n");
|
= note: `bool_comparison` is `warn` by default#import "Basic";
main :: () {
ready := true;
if ready print("ready\n");
}Only when the other side is a non-constant bool.