[fpc-devel] Class property and virtual getter

Sven Barth pascaldragon at googlemail.com
Thu Feb 27 17:37:05 CET 2014


Am 27.02.2014 15:35, schrieb Hans-Peter Diettrich:
> Also "self" is no more known inside class methods in XE. In D7 it was 
> the class type instead of the instance pointer. Thus a too restrictive 
> compiler, geared towards compatibilitiy with *new* Delphi versions, 
> may break existing code.
Source please. This compiles and runs without problems in XE:

=== source begin ===

type
   TTest = class
     class procedure Test;
   end;

class procedure TTest.Test;
begin
   Writeln(Self.ClassName);
end;

begin
   TTest.Test;
   Readln;
end.

=== source end ===

=== output begin ===

TTest

=== output end ===

It would be very strange if Embarcadero would have changed that.

Regards,
Sven



More information about the fpc-devel mailing list