<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 19, 2020 at 10:11 AM Ondrej Pokorny via lazarus <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Well, generics may cause an internal error on a simple compile. A
clean rebuild is needed to compile even after a small change.<br></div></blockquote><div><br></div><div>It may be true when a generics class definition changes. Typically they don't change often.<br></div><div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<p>This happens a lot for me now. Sometimes in the changes from
r62639, sometimes in different code. If I work on the source of
the Lazarus IDE and I recompile it, I get an internal error. Then
I have to rebuild Lazarus IDE clean, which takes a lot of time.</p></div></blockquote><div> r62639 required a clean compile also because the container class was moved to LazUtils. Other containers are already there.<br></div><div>If the old .ppu remains in its old place, it causes an incompatible ppu error.</div><div>An internal error happens because of a bug in FPC. I also get them a lot but I didn't notice any connection to generics. The error comes in unexpected places, not related to changes I made. Usually no generics are used there.</div><div>I am also worried when the FPC bug or bugs get fixed. It is not a new thing and it may have gotten worse. There are bug reports like:</div><div> <a href="https://bugs.freepascal.org/view.php?id=33087">https://bugs.freepascal.org/view.php?id=33087</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p>It is really frustrating when this happens every 10 minutes :/ I
really don't see a point to change working code to generics.<br></p></div></blockquote><div><div>Please don't blame my refactoring if it happens every 10 minutes. It was a one-time shot.<br></div><div>The change was related to a substantial new feature for the package system provided by Sven Barth.</div><div>See issues :<br></div><div> <a href="https://bugs.freepascal.org/view.php?id=36654">https://bugs.freepascal.org/view.php?id=36654</a></div><div> <a href="https://bugs.freepascal.org/view.php?id=36734">https://bugs.freepascal.org/view.php?id=36734</a></div><div>Generics make a lot of sense in containers bringing type checking and safety also there. The code becomes more self-documenting as well.<br></div><div>In this particular case the container usage was not obvious. The Pointer -> Pointer container was used in 2 different ways in the same unit, now specialized as TPackagePackageArray and TOwnerPackageArray.</div><div>Unit ObjectLists is now used only in unit PkgManager but it looks like a useful container and deserves to be in LazUtils.<br></div><div><br></div><div>Juha</div><div><br></div></div></div></div>