1
vote
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 ...
Statistics
|
Visits by Source |
User Actions |




