Our website uses cookies to enhance your browsing experience.
Accept
to the top

Webinar: Let's make a programming language. Lexer - 29.04

>
>
>
V7005. Variable is assigned to itself.
menu mobile close menu
Additional information
toggle menu Contents

V7005. Variable is assigned to itself.

Apr 03 2026

The analyzer has detected a potential error when a variable is assigned to itself.

The example:

change(width, height, length) {
  this.width = width;
  this.height = height;
  length = length;
}

In this method, the fields should receive values from the method parameters with matching names. However, a typo causes an error: instead of modifying the length field, a parameter with the same name is assigned to itself.

The fixed code:

change(width, height, length) {
  this.width = width;
  this.height = height;
  this.length = length;
}