With the requested changes I believe some precedence rules have changed. These 
both should be "Can't determine which overloaded function to call" errors or 
the non-generic should take precedence because the functions are ambiguous (by 
appearance at least). Currently the compiler thinks DoThis<T> is better than 
the non-generic and this may be because it was specialized as DoThis<ShortInt> 
because the parameter of "1" is a ShortInt.

What should the rule be here?

=====================

procedure DoThis(a: word; b: word);
begin
end;

generic procedure DoThis<T>(a:T; b: word);
begin
end;

begin
  DoThis(1,1); // DoThis<T>
end.

=====================

generic procedure DoThis<T>(a:T; b: word);
begin
end;

generic procedure DoThis<T>(a: word; b: T);
begin
end;

begin
  DoThis(1,1); // Can't determine which overloaded function to call
end.

=====================


Regards,
        Ryan Joseph

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

Reply via email to