[fpc-pascal] Constants in generics

Ryan Joseph ryan at thealchemistguild.com
Mon Nov 26 15:47:19 CET 2018



> On Nov 26, 2018, at 8:18 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> You don't need to manually check for U. The parser will find U in the symbol table of the TMyClass generic and then a list containing the parameters will be generated and passed to parse_generic_specialization_type_internal. Though we'll probably either have to adjust the type of the paradeflist to carry the type/constant sym instead of the Def or an additional list that contains the constant symbols (plus NILs for the type ones). 
> I currently favor the first one, which will mean a few more adjustments inside pgenutil when parsing specialization parameters.

I get a "class type expected, but got "<erroneous type>”” on the “U” in the nested specialization so I assumed this was because the hidden constant “U” was getting parsed instead of the generic param type “U”. I need to look at this more closely tomorrow because I don’t really understand what’s happening to be honest.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list