> On Aug 26, 2020, at 5:44 PM, Nico Neumann via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> generic procedure Add<T>;
> begin
>     if GetTypeKind(T) = tkInteger then WriteLn('an integer');
>     if GetTypeKind(T) = tkString then WriteLn('a string');
> end;

Question for the compiler team why doesn't the "is" operator work for types? We 
should be able to do:

if T is integer then
  ;

and get something which is well optimized.

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