[fpc-devel] Proof of Concept ARC implementation

Sven Barth pascaldragon at googlemail.com
Mon Oct 27 19:46:48 CET 2014


Am 27.10.2014 16:23, schrieb Sven Barth:
>
> Am 27.10.2014 14:54 schrieb "hinstance at yandex.ru 
> <mailto:hinstance at yandex.ru>" <hinstance at yandex.ru 
> <mailto:hinstance at yandex.ru>>:
> >
> > I tested it a bit; thoughts so far:
> > 1. generic and refcounted do not work well together: no matter how I 
> arrange it, a class can't be both generic and refcounted, it causes 
> the compiler to produce some internal error 2014092205.
>
> Oh, good to know. I'll take a look at that when I find the time :) 
> (and that internal error is one I added for that feature, so that's a 
> "good" sign as well ;) )
>
Do you have an example? I tried this and it works:

=== code begin ===

program trefcounted;

{$mode objfpc}

type
   generic TTest<T> = class refcounted
   end;

   TTestLongInt = specialize TTest<LongInt>;

var
   t: TTestLongInt;
begin
   t := TTestLongInt.Create;
end.

=== code end ===

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20141027/070c5056/attachment.html>


More information about the fpc-devel mailing list