Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It seems that sometimes Delphi is case-sensitive - "override method should match case of ancestor"

Today I've encountered a 'strange' hint:

override method xxxx should match case of ancestor yyyy.

Solution was to declare the method name exactly as in the ancestor....I believe this is something which rested in the compiler since the Delphi.Net compiler...

Declaring the method exactly as in the ancestor made the compiler 'silent'. There are other 'case-sensitive' hints/warnings in Delphi 2006 and up?

like image 236
RBA Avatar asked Oct 13 '11 13:10

RBA


People also ask

Is Delphi case sensitive?

Delphi is case insensitive.

Is Go Language case sensitive?

The Go Language is case sensitive.

Is Golang case sensitive or insensitive?

In Golang string are UTF-8 encoded. strings package of GO provides an EqualFold method that can be used to do case insensitive comparison of two strings in Go.


1 Answers

It's a hint that's in place to protect your code when cooperating with 3rd party code.
This hint was introduced with the addition of Delphi for .net, because some other .net platforms are case-sensitive.

Note that the hint does not imply any case sensitivety on Delphi's part.
Only in point 1 below is Delphi itself case sensitive, point 2 is an artifact of the way the Delphi compiler calls the case-sensitive function GetProcAddress() in the Windows API.

Case sensitive behavior in Delphi

1-Registering components
I don't know of any other hints that are case sensitive, but note that when you write your own components and you want to register them, the register function that you declare must be written like so:

procedure Register;  <<-- Leading capital required.  

If you don't Delphi will not add your new component.

2-Importing external functions

As stated by David, when importing external functions, the exact case used in the DLL must be preserved.

Individual hints cannot be disabled
Note that you cannot disable a specific hint: Can specific Delphi hints be disabled?

like image 140
Johan Avatar answered Oct 06 '22 01:10

Johan