[fpc-devel] Proof of Concept ARC implementation

Sven Barth pascaldragon at googlemail.com
Thu Oct 30 10:29:59 CET 2014


On 30.10.2014 04:15, Hans-Peter Diettrich wrote:
> Sven Barth schrieb:
>> On 28.10.2014 09:57, Hans-Peter Diettrich wrote:
>
>>>>>>  > Something like ShortString and AnsiString?
>
>>>> Take unit Typinfo for example where quite some methods take a TObject
>>>> instance.
>>>
>>> The TypInfo methods can determine the exact type of their arguments, and
>>> act inside accordingly.
>>
>> If you have a method X that takes a TObject parameter how do you plan
>> to pass it a reference counted object when these and TObject are not
>> compatible *at compiletime*?
>
> That's intentionally impossible in general.For TypInfo, a dedicated
> method (override) can be added, or an untyped parameter can be used like
> in FreeAndNil.

The only viable solution would be additional overloads, because for an 
untyped parameter you can't use TypeInfo(). It's even questionable 
whether reference counted objects should be assignable to pointers or 
untyped parameters...

But considering that I'm not a fan of this "not compatible" anyway, I 
personally won't think much about that :)

Regards,
Sven



More information about the fpc-devel mailing list