> On Apr 25, 2022, at 4:11 PM, Sven Barth <pascaldra...@googlemail.com> wrote:
> 
> Then you don't think creative enough. Think about (de)serialization code for 
> binary data which needs to use the correct size. If done correctly this can 
> very well be handled with a generic. 
> 

Oh yes that’s right. I guess I would need some real examples of a function that 
used type information and could suffer a failure by the compiler assuming the 
wrong type from a constant like “1”. If you were deserializing you would 
probably be passing in a very particular type and not some ambiguous thing like 
a number literal.

Having said that there should be type restrictions for Integer, Real, Boolean 
and String (maybe Char) etc… Right now only class, record and interface are 
supported.

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