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

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

>
>
>
V8011. Identical expression to the...
menu mobile close menu
Additional information
toggle menu Contents

V8011. Identical expression to the left and to the right of compound assignment.

Apr 03 2026

The analyzer has detected that identical expressions surround a compound assignment operator. The operation may be incorrect and redundant, or it can be simplified.

The example:

x -= x - 5

In this case, the expression assigns the 5 value to the x variable. Most likely, the intended operation is to subtract 5 from the x variable.

The fixed code:

x = x - 5

Another option:

x -= 5

The diagnostic rule also applies to the following operators: +=, *=, /=, and %=.