<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ryan Joseph via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Mo., 2. Dez. 2019, 14:01:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Nov 30, 2019, at 12:58 PM, Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
> <br>
> This can't work. ClassType is of type TClass and TClass.Create calls TObject.Create, *not* the constructor of your list type, cause the constructor chain is not virtual.<br>
<br>
Ok, so if the constructor was virtual this would work as expected? I guess that make sense. <br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">In this specific case: not really. Because TFPSList has a different constructor signature than TFPGList<>. And even then you'd need to cast ClassType to a "class of TFPSList" type as TObject.Create is never virtual. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>