On Mon, 7 Oct 2019, Mattias Gaertner via fpc-pascal wrote:


Should the compiler choose the 3rd non-generic function, or still
give an error ?

You mean, if a bad overload can be nullified by a good one? That would
be insane...

Yes, Delphi eats it without warning.

And it works even with a generic param:

generic function Run<T,U>(a: T; b: U): T; overload;
begin end;
generic function Run<T>(a: T; b: word): T; overload;
begin end;

Run(3,word(4));

So do I understand you correctly and Delphi's behaviour is insane ? :-)

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

Reply via email to