D2007中的静态类方法的类型

时间:2017-05-10 08:44:58

标签: delphi function-pointers static-methods delphi-2007

在XE6中,以下编译:

type
  TMyProc = procedure(AInt: Integer);

  TMyClass = class
    class procedure Proc(AInt: Integer); static;
  end;

procedure Test;
var
  proc: TMyProc;
begin
  proc := TMyClass.Proc; // error here in D2007
end;

在D2007中,这给出了关于不兼容类型的错误E2009。我知道在D2007中静态类方法和全局例程aren't assignment-compatible但是有不同的方法来定义TMyProc以便上面的编译在D2007中吗?

0 个答案:

没有答案
相关问题