Hello!

In Delphi it is valid to assign a static class procedure to a procedure variable:

program project1;

type
  TMyObject = class
  public
    class procedure Proc; static;
  end;

  TProc = procedure();

class procedure TMyObject.Proc;
begin

end;

var
  xProc: TProc;
begin
*  xProc := @TMyObject.Proc;**
*end.

(In Delphi just without the @ operator, obviously.)

In FPC 3.1.1 (trunk) I get the following error:

project1.lpr(22,12) Error: Incompatible types: got "<class method type of procedure of object;Register>" expected "<procedure variable type of procedure;Register>"

Why? Can it be achieved somehow (compiler settings)?

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

Reply via email to