> On Dec 3, 2018, at 2:45 PM, Ryan Joseph <r...@thealchemistguild.com> wrote:
> 
> I just looked it over and I was wrong about the dummy, it’s just a flag. If 
> the generic doesn’t cover existing functions then that messes up some 
> assumptions I made so I need re-think the design now.

I believe I managed to solve the problem and now non-generic procedures take 
precedence. I guess it’s possible that you could opt out of an implicit 
specialization now but declaring and overload which the specific type you were 
interested in. This is probably a good fallback to have so it’s good it’s like 
this now.

{$mode objfpc}
{$modeswitch implicitgenerics}

program gi_implicit_overload;

procedure DoThis(msg:integer);overload;
begin
        writeln('DoThis:',msg);
end;

generic procedure DoThis<T>(msg:T);overload;
begin
        writeln('DoThis$1:',msg);
end;

begin
        DoThis(1);              // DoThis:1
        DoThis('string’);       // DoThis$1:string
end.


Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to