<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Mattias Gaertner via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Mo., 25. Apr. 2022, 13:50:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>>[...]<br>
> type<br>
>   generic TArrayHelper<T> = type helper for array of T<br>
>     procedure Add(value: T);<br>
>   end;<br>
> <br>
> var<br>
>   a: array of integer;<br>
> begin<br>
>   a.Add(1);  // specialize TArrayHelper<Integer> since the compiler<br>
> clearly knows the type used is Integer. end.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">For some reason I don't get all mails by Ryan, so I reply here:</div><div dir="auto"><br></div><div dir="auto">Helpers currently can't be generic and even if they could be (which I do plan to add) it would require an explicit specialization of the helper to be used because the compiler will not be tasked with searching for potential generic helpers and then implicitly specializing a whole helper type with all its methods to maybe use it for an implicit specialization (and it needs to specialize the helper first to decide whether it even remotely contains suitable methods). </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div></div>