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

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

>
>
>
V8020. Recurring check. This...
menu mobile close menu
Additional information
toggle menu Contents

V8020. Recurring check. This condition was already verified on a previous line.

Apr 03 2026

The analyzer has detected a potential error: the same condition is being checked twice.

Examples:

// Example N1

if A == B {
  if A == B {
    ....
  }
}

// Example N2

if A == B {
  ....
} else {
  if A == B {
    ....
  }
}

In the first case, the second A == B check is always true. In the second case, it is always false. Such code may result from refactoring or from using the wrong variable by mistake.

The fixed examples:

// Example N1

if A == B {
  if A == C {
    ....
  }
}

// Example N2

if A == B {
  ....
} else {
  if A == C {
    ....
  }
}