Back

LL044

Missing case else branch

Object Pascal — Delphi & Free Pascal
Info
Reliability

A case statement without an else branch silently ignores unexpected values

a case statement without an else branch silently ignores unexpected values.

Why this severity

a case statement without an else branch silently ignores unexpected values.


Known false positives

exhaustive enumerations where every value is explicitly handled.

Remediation example

case Status of
  stActive: HandleActive;
  stInactive: HandleInactive;
else
  raise EUnknownStatus.Create('Unexpected status');
end;

Reconnecting… Connection lost. Reload