[fpc-pascal] generic proc inference

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Oct 7 20:03:53 CEST 2019


On Mon, 7 Oct 2019 19:47:58 +0200
Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

> Mattias Gaertner via fpc-pascal <fpc-pascal at lists.freepascal.org>
> schrieb am Mo., 7. Okt. 2019, 18:42:
> 
> > On Mon, 7 Oct 2019 12:38:51 -0400
> > Ryan Joseph <genericptr at gmail.com> wrote:
> >  
> > > > On Oct 7, 2019, at 10:19 AM, Mattias Gaertner via fpc-pascal
> > > > <fpc-pascal at lists.freepascal.org> wrote:
> > > >
> > > > Note that in Delphi the "non-generic-wins" rule is per
> > > > parameter:
> > > >
> > > > procedure Run<T>(a:T; b: word);
> > > > procedure Run<T>(a: word; b: T);  
> > >
> > > I mean what happens here? The non-generic functions wins right?
> > >
> > > procedure Run<T>(a:T; b: word);
> > > procedure Run<T>(a: word; b: T);
> > > procedure Run(a: word; b: word);  
> >
> > Only for
> > Run(word(1),word(2));
> >  
> 
> Just to be sure: does the order of the function declarations make a
> difference?

No. Even if the a,b:word overload is in the ancestor.

Mattias


More information about the fpc-pascal mailing list