Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-04

STATIC can only be used on non-virtual class methods

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

silvioprog

Hello,

Consider the following code:

=== test begin ===

{$MODE DELPHI}
  TStaticVirtualTest = class sealed(TObject)
  public
    class procedure Test; virtual; static;
  end;
class procedure TStaticVirtualTest.Test;
begin
end;

=== test end ===

You can compile it in FPC (trunk), but, when you try to compile it on Delphi (Seattle):

=== error begin ===

E2376 STATIC can only be used on non-virtual class methods

=== error end ===

Is this a FPC bug?

Thank you!

Silvio Clécio