> On Apr 25, 2022, at 2:39 PM, Martin Frb via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> Actually, it's dealing with SmallInt (or ShortInt). And if the programmer 
> does not know that, then it might be an issue...
> 
> Imagine the generic code (something more complex than "Add") would somehow do 
> something that differs for SmallInt and Integer. Like using "SizeOf(T)".

This is almost a case that requires better type restrictions. If your generic 
function relies specifically on some particular type information this is almost 
not really even a good candidate to be generic at all. 

Regards,
        Ryan Joseph

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

Reply via email to