[fpc-pascal] Two possible generics bugs
pascaldragon at googlemail.com
Mon Dec 2 14:47:56 CET 2019
Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Mo., 2. Dez. 2019, 14:01:
> > On Nov 30, 2019, at 12:58 PM, Sven Barth via fpc-pascal <
> fpc-pascal at lists.freepascal.org> wrote:
> > 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.
> Ok, so if the constructor was virtual this would work as expected? I guess
> that make sense.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal