+5
Planned

Warn about unused local constants

Anonymous 10 years ago updated by Roman 10 years ago 2
If you have a method which declares some constants, and those constants are not used, no warning is generated by Delphi.  IMO there should be a warning, just like for variables that are not used.

Eg,
procedure TForm1.Foo;
const
 A = 1;
 B = 2;
var
 C,
 D : Integer;
begin
 C := B;
 Caption := IntToStr(C);
end;

Delphi warns about unused variable D, but not unused constant A.