[fpc-pascal] generic proc inference

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Oct 6 23:42:29 CEST 2019


On Sun, 6 Oct 2019 17:10:54 -0400
Ryan Joseph <genericptr at gmail.com> wrote:

> > On Oct 6, 2019, at 5:03 PM, Ryan Joseph <genericptr at gmail.com>
> > wrote: 
> >> On Oct 6, 2019, at 2:06 PM, Mattias Gaertner via fpc-pascal
> >> <fpc-pascal at lists.freepascal.org> wrote:
> >> 
> >> 1.
> >> FPC allows default params, Delphi does not. Nice.
> >> I see no tests for this though, so maybe this was not on purpose?  
> > 
> > Probably an oversight if you can believe it. I’ll test that.  
> 
> Yeah this didn’t work so I need to think about it. Should it even be
> allowed though? That means the type can only be specialized the same
> as the constant?
> 
> generic procedure DoThis<T>(param1: string; param2: T = 100);
> begin
> end;

I meant:

generic procedure DoThis<T>(param1: T; param2: word = 100);
begin
end;

Mattias


More information about the fpc-pascal mailing list