[fpc-devel] Problem with generic parameter

Thorsten Engler thorsten.engler at gmx.net
Mon Jan 2 05:28:54 CET 2017


Hi,

 

Independent of what Delphi may support or not (and I agree that at a minimum in $mode Delphi fpc should not require that IFDEF)… 

 

in a modern compiler I would expect the generic type parameter to be optional in this specific scenario and the compiler infer it from the type of the parameters.

 

Cheers,

Thorsten

 

From: fpc-devel-bounces at lists.freepascal.org [mailto:fpc-devel-bounces at lists.freepascal.org] On Behalf Of Gennady Agranov
Sent: Monday, 2 January 2017 06:23
To: fpc-devel at lists.freepascal.org
Subject: Re: [fpc-devel] Problem with generic parameter

 

Hi Sven,

Based on bug#20503 you are in charge of support for "generics"?
Thanks a lot for your work!

What about this incompatibility - is it a known issue?

        {$ifdef FPC}
        if Arrays<TTreeNode>.BinarySearch(changes.m_children,node,j,getComparatorByName) then
        {$else}
        if Arrays.BinarySearch<TTreeNode>(changes.m_children,node,j,getComparatorByName) then
        {$endif}

Thanks,
Gennady

On 12/31/2016 1:25 PM, Sven Barth wrote:

Am 31.12.2016 10:33 schrieb "Дмитрий Померанцев" <pda2 at yandex.ru <mailto:pda2 at yandex.ru> >:
>
> Welcome to five years old bug. :)
> http://bugs.freepascal.org/view.php?id=20503

Nope, that's not the same problem. Also the code example of the thread starter did not contain a generic method.

Regards,
Sven






_______________________________________________
fpc-devel maillist  -  fpc-devel at lists.freepascal.org <mailto:fpc-devel at lists.freepascal.org> 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20170102/5f4cb125/attachment.html>


More information about the fpc-devel mailing list