[Pas2js] How I do it?

Michael Van Canneyt michael at freepascal.org
Fri Feb 11 11:22:51 CET 2022



On Fri, 11 Feb 2022, Henrique Gottardi Werlang wrote:

> I'm having a question of how to declare some generic functions in FPC.
>
> At Delphi I declare them like this:
>
> type
>  TProc = reference to procedure;
>  TProc<T> = reference to procedure (Arg: T);
>  TProc<T1, T2> = reference to procedure (Arg1: T1; Arg2: T2);
>
> How do I make an equivalent statement in FPC?

You can't, currently, in ObjFPC mode.

We're coordinating with the FPC compiler team. 
They forbid it to allow omitting the <t> in method implementations.

As far as I understood, it should work in Delphi mode; but I didn't check
that.

Michael.


More information about the Pas2js mailing list