I’ve been following CodeRage III these days and presenter mentioned that in Delphi 7 (and above), when overriding virtual methods, the same case should be used for both functions.
Consider this example:
type TClass1 = class procedure VirtualMethod; virtual; abstract; end; TClass2 = class(TClass1) procedure virtualmethod; override; end; procedure TClass2.virtualmethod; begin end;
In this case indeed the compiler will issue this warning:
[DCC Hint] Project2.dpr(14): H2365 Override method TClass2.virtualmethod should match case of ancestor TClass1.VirtualMethod
Why is the case important? Delphi is case-insensitive. Considering that this change came from Delphi 7 we can assume it was related to “preparations for .NET”. Considering that .NET IL is case-sensitive (in case of identifiers) this warning makes sense if you’re trying to extend some .NET class. Now that Delphi.NET is dead, maybe the compiler team will clean up this mess a bit.