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

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

>
>
>
V7014. An identical expression to...
menu mobile close menu
Additional information
toggle menu Contents

V7014. An identical expression to the left and to the right of a compound assignment.

Apr 03 2026

The analyzer has detected that identical expressions surround a compound assignment operator (+=, -=, *=, \=). The operation may be incorrect, or it can be simplified.

The example:

x += x + 5

In this case, it is intended to add 5 to the x variable, but incorrectly specified the x variable twice.

The fixed code:

x += 5

Most likely, the code is correct, but it is recommended to rewrite it to enhance readability: two additions of x can be replaced with a multiplication by 2.

More readable option:

x = x * 2 + 5;