I just realized one more type introspection related issue. This currently will 
specialize as DoThis<ShortInt>  because the array constructor element type is 
"shortint" as is derived from the first element 1. This of course is not 
correct so I'd like to reject "array of const constructors" but I don't see how 
to know what when I get this type.

 I thought the tarraydef would have ado_IsArrayOfConst set but it does not, so 
how do I know the array constructor has multiple element types?

generic procedure DoThis<T>(a: array of T);
begin
end;

begin
  DoThis([
    1,
    'string',
    'c',
    TObject.Create
  ])
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