Sven Barth schrieb:
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;

When you add "static;", as required for class property getters/setters, the following won't compile:

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

So the lack of "Self" seems to apply to "static;" methods, not to "class" methods. I'll ask in an EMBT group for a description of "static;", the OH seems to reflect the C++ meaning only, without mentioning the impact on OPL classes.

DoDi

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to