Esc

manual_assign_op

Finds a = a + b instead of a += b.

Category complexity, warn by default.

Example
#import "Basic";

main :: () {
    total := 10;
    price := 5;

    total = total + price;

    print("%\n", total);
}
Diagnostic
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
Fixed
#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.