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

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

>
>
>
V7004. The 'then' statement is...
menu mobile close menu
Additional information
toggle menu Contents

V7004. The 'then' statement is equivalent to the 'else' statement.

Apr 03 2026

The analyzer has detected a suspicious code fragment where both branches of an if statement are same. This often indicates an error.

The example:

if (cond)
  result = firstFunc(val);
else
  result = firstFunc(val);

Regardless of the value of the cond expression, the same operations are performed. Most likely, such code contains an error.

The fixed code:

if (cond)
  result = firstFunc(val);
else
  result = secondFunc(val);