I’ve looked into this more today and I don’t see how we can get around needing 
a typesym for specializations.


For example:

generic procedure DoThis<T>(msg: T);
begin
end;

var
        a: array of char;
begin
        DoThis(a);


Is going to specialize as DoThis<array of char>(a). “array of char” is (for 
lack of the proper term) an anonymous dynamic array and would be not a valid 
specialization unless an explicit type was declared.

For strings I figured out I could use the built-in system type 
“cshortstringtype” if is_chararray() return true (for specializing string 
constants like in my initial question) but that is specific to string constants.

For normal function calls this isn’t a problem because the type is always 
specified but for implicit specializations the type may need to be declared in 
order for the specialization to be possible.

Regards,
        Ryan Joseph

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

Reply via email to