There is a compilation error when defining body of a static method the unified way when it participates as a metaclass.
It works however, if the body is defined in implementation section.
Error case:
namespace StaticMethods;
interface
type
Program = class
public
class method Main(args: array of String): Int32;
end;
TA = class
public
class method foo; begin writeLn ('static foo'); end; // compilation error
class method bar; // works
end;
metaclass = class of TA;
implementation
class method TA.bar; begin writeLn ('static bar'); end;
class method Program.Main(args: array of String): Int32;
begin
TA.foo;
TA.bar;
end;
end.