[fpc-pascal] Constants in generics

Sven Barth pascaldragon at googlemail.com
Mon Nov 26 22:59:00 CET 2018

Am Mo., 26. Nov. 2018, 15:47 hat Ryan Joseph <ryan at thealchemistguild.com>

> > 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.

Best check again once you've done the switch to tconstsym for constants. :)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20181126/e328f2e5/attachment.html>

More information about the fpc-pascal mailing list