Vote UpVote

On the type compatibility in Delphi

The Programming Works – Delphi compiler evolves much faster than Delphi documentation, and some language features remain unnamed. Consider the following code snippet: type MyPChar1 = PChar; MyPChar2 = type PChar; MyPChar3 = ^Char; procedure Test(Ch: PChar); begin end; procedure TForm1.Button4Click(Sender: TObject); var Ch1: MyPChar1; Ch2: MyPChar2; Ch3: MyPChar3; begin Test(Ch1); // Test(Ch2); Error E2008 Incompatible types // Test(Ch3); Error E2010 Incompatible types: 'Unit1.Char' and 'System.Char' end; The documentation states that MyPChar1 and PChar are identical types, while MyPChar2 ...
Favorite? Off-Topic? Serg @ 2012-01-12 17:08


Visits: 775
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)