[fpc-pascal] Generics question

Bart bartjunk64 at gmail.com
Sun Dec 2 23:28:00 CET 2018


Hi,

  { TFoo }

  generic TFoo<T> = class
    procedure Bar;
  end;

{ TFoo }

procedure TFoo.Bar;
  procedure localproc;
  begin end;
begin
end;

This will not compile (fpc 3.0.4):
gentest.lpr(35,4) Error: Generic methods cannot have nested procedures

While the message is clear, the reason for this is not (to me at last).

Does anybody know why?

Bart
-- 
Bart



More information about the fpc-pascal mailing list