Skip to content
  • Sven/Sarah Barth's avatar
    Fix for Mantis #22160 · 88af2931
    Sven/Sarah Barth authored
    The cause of the internal error was the following:
    We have a generic in an unit ("A") which uses another unit ("B") in the implementation section and this other unit uses unit A in the interface section. Now the generic is specialized in the interface section of B. This leads to the problem that in unit A when it tries to load the globalsymtable of unit B that globalsymtable will be Nil, because parsing of the interface section is not yet finished. Thus the change in pgenutil.pas, specialization_init: if the unit is still "in_interface" the localsymtable needs to be used instead of the globalsymtable.
    
    This doesn't necessarily lead to a compiling test though, as there is the following possibility:
    Unit A contains a generic class/record (with methods) and uses unit B in the implementation section. This unit B also contains a generic class/record (with methods) and uses unit A in the implementation section. Both units contain a specialization of the other unit's generic outside of it's...
    88af2931