2016-03-31 17:06 GMT+02:00 Michael Van Canneyt <mich...@freepascal.org>:
> I imagine so, yes. > > It is one of the reasons why I don't really see the usefulness of this > construct, except that it looks OOP-ish. > > It is mostly for initialization "class var" related stuff inside records and classes. Very usefully especially with generics. Even more - there is no workaround for class constructor/destructor when generics are used (more details in Generics.Collections for example for "cuckoo" dictionary). 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). another bugs related to class constructor/destructor: http://bugs.freepascal.org/view.php?id=28911 http://bugs.freepascal.org/view.php?id=29245 -- Best regards, Maciej Izak
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal