Back

LL071

Self-assignment

Object Pascal — Delphi & Free Pascal
Warning
Reliability

Assigning a variable to itself is a no-op and indicates a copy-paste bug

assigning a variable to itself is a no-op and indicates a copy-paste bug.

Why this severity

assigning a variable to itself is a no-op and indicates a copy-paste bug.


Known false positives

none expected; this pattern is always a defect.

Remediation example

TargetName := SourceName;
// instead of: TargetName := TargetName;

Reconnecting… Connection lost. Reload