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

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

>
>
>
V8003. Consider inspecting the...
menu mobile close menu
Additional information
toggle menu Contents

V8003. Consider inspecting the expression. Probably one of the operators should be used here: '-=', '+=' or '!='.

Apr 03 2026

The analyzer has detected a potentially incorrect sequence of characters =+, =-, or =!. It may indicate a typo. To avoid this, use +=, -=, or != respectively.

The example:

var size, delta int
...
size =+ delta

In the fragment, the delta value is assigned to the size variable after the unary plus operator, since the unary plus and assignment operators are bounded. This is most likely a typo, and the intention was to add the value of the delta to size using the += operator.

The fixed code:

var size, delta int
...
size += delta

The code example for which the analyzer will not issue the warning:

size += delta
size = +delta

The diagnostic rule can also detect the typos, including constructs like A =- B and A =! B.