Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V8005. The 'then' statement is...
menu mobile close menu
Analyzing projects
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)
}

This diagnostic rule is classified as:

You can look at examples of errors detected by the V8005 diagnostic.