<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-03-31 17:06 GMT+02:00 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I imagine so, yes.<br>
<br>
It is one of the reasons why I don't really see the usefulness of this<br>
construct, except that it looks OOP-ish.<br>
<br></blockquote><div><br></div><div>It is mostly for initialization "class var" related stuff inside records and classes. Very usefully especially with generics. <br><br></div><div>Even more - there is no workaround for class constructor/destructor when generics are used (more details in Generics.Collections for example for "cuckoo" dictionary).<br><br></div><div>Current implementation is DEFINITELY buggy and mentioned in topic behavior should be reported as bug. Class constructor/destructor should be used only when type is somehow used in code or when is used directive like {$STRONGLINKTYPES ON} (which FPC don't have).<br><br></div><div>another bugs related to class constructor/destructor:<br><a href="http://bugs.freepascal.org/view.php?id=28911">http://bugs.freepascal.org/view.php?id=28911</a><br><a href="http://bugs.freepascal.org/view.php?id=29245">http://bugs.freepascal.org/view.php?id=29245</a><br></div><div> <br clear="all"></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>