LYR-SEM0203
an assignment of a value to itself
An = whose value is its own target — x = x, a.b = a.b — or x = x++, which keeps the old value.
Explanation
Assigning a place to itself changes nothing. It is usually a typo for another name, and x = x++ reads as an increment while it is none: the value assigned is the old one.
Assign what was meant, or take the statement out; write x++ alone to increment.
Wrong
fn main(): void {
var x = 1;
x = x;
let _ = x;
}
Right
fn main(): void {
var x = 1;
x = x + 1;
let _ = x;
}