[Pas2js] Generic procedure type declaration

Michael Van Canneyt michael at freepascal.org
Fri Jun 4 14:14:11 CEST 2021



On Fri, 4 Jun 2021, Henrique Gottardi Werlang wrote:

> I tried to find in the FPC documentation how to declare a generic procedure type, but i didn't find out.
>
> What I'm trying to declare is something like this:
>
> TMyProcType<T> = procedure(Param: T);
>
> This kind of statement is made in Delphi, but I didn't figure out how to do it in FPC.

Works as-is:

home:~> fpc tgm.pp
home:~> pas2js tgm.pp
Info: 1156 lines in 2 files compiled, 0.0 secs
home:~> cat tgm.pp
{$mode delphi}

Type
   TMyProcType<T> = procedure(Param: T);

begin
end.



More information about the Pas2js mailing list