manual_assign_op
Finds a = a + b instead of a += b.
Category complexity, warn by default.
#import "Basic";
main :: () {
total := 10;
price := 5;
total = total + price;
print("%\n", total);
}warning[manual_assign_op]: `total` is updated with `+` spelled out
--> example.jai:7:5
|
7 | total = total + price;
| ^^^^^^^^^^^^^^^^^^^^^
|
help: write `total += price`
|
7 ~ total += price;
|
= note: `manual_assign_op` is `warn` by default#import "Basic";
main :: () {
total := 10;
price := 5;
total += price;
print("%\n", total);
}Target must be side-effect-free and the operation must keep its type.