[fpc-pascal] Constants in generics

Sven Barth pascaldragon at googlemail.com
Sat Nov 10 18:42:28 CET 2018

Am Sa., 10. Nov. 2018, 14:47 hat Ryan Joseph <ryan at thealchemistguild.com>

> > On Nov 10, 2018, at 7:22 PM, Florian Klämpfl <florian at freepascal.org>
> wrote:
> >
> > If you "export" a generic taking a const from a unit, this info has to
> be stored in the ppu.
> Can you show a test case I could use to see where this is triggered in the
> compiler? I don’t even know where to begin looking.

The important part are the ppuwrite and ppuload methods that are provided
by tstoreddef, tstoredsym and tstoredsymtable and overridden by most of
their descendants. E.g. tstoreddef itself is also dealing with the generic

And for a test: declare the generic in one unit, specialize it in another
and compile twice. Usually things go boom if you messed up something.

By the way: When adding/changing data that is written to the PPU increase
the PPUVersion constant in the ppu.pas unit (there is no backwards
compatibility for PPUs) and also adjust the ppudump utility in


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

More information about the fpc-pascal mailing list