[fpc-devel] Getting built-in string type

Sven Barth pascaldragon at googlemail.com
Thu Feb 28 19:44:09 CET 2019


Am 28.02.2019 um 03:11 schrieb Ryan Joseph:
> Sending this again to see if it gets through (posts getting blocked again).
>
>> On Feb 26, 2019, at 2:43 PM, Ryan Joseph <ryan at thealchemistguild.com> wrote:
>>
>> In my implicit generic specialization code I have one place where I get a string const node (stringconstn) which the resultdef is arraydef (not stringdef like I would expect). I then need to substitute this for a typesym so I can match the function parameters but how do we I find a typesym for the string type?
>>
>> Currently I’m using searchsym_type but hardcoding the type name is probably not the right solution.
>>
>> 	searchsym_type('SHORTSTRING',srsym,srsymtable);
Right now I don't remember your changes, but it might be that you're 
using the wrong approach: You shouldn't need to match anything by 
yourself as the required infrastructure is already in place. You should 
extend htypechk (which does the overload resolution) and defcmp (which 
compares the defs of parameter values and parameter declarations in this 
case) so that unspecialized generic routines are found (in htypechk) and 
checked correctly (in defcmp) and then specialized.

Regards,
Sven



More information about the fpc-devel mailing list