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

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

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

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

Apr 03 2026

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

The example:

if cond {
  result = FirstFunc(val)
} else {
  result = FirstFunc(val)
}

Regardless of what the cond expression evaluates to, the same operations will be performed. Such code contains an error.

The fixed code:

if condition {
  result = FirstFunc(val)
} else {
  result = SecondFunc(val)
}