Back

LL080

Assignment in condition

Object Pascal — Delphi & Free Pascal
Error
Reliability

:= inside an if or while condition is almost certainly a typo for = comparison

:= inside an if or while condition is almost certainly a typo for = comparison.

Why this severity

:= inside an if or while condition is almost certainly a typo for = comparison.


Known false positives

none expected; Delphi does not support intentional assignment in conditions.

Remediation example

if X = 10 then
  DoWork;
// instead of: if X := 10 then

Reconnecting… Connection lost. Reload