[fpc-devel] potential bug, generics vs helpers

Sven Barth pascaldragon at googlemail.com
Fri Jan 27 17:49:28 CET 2012


Am 27.01.2012 17:25, schrieb Marco van de Voort:
> In our previous episode, Kornel Kisielewicz said:
>>> ?B := A;
>>> end;
>>
>> Does it also work (in Delphi and in FPC Delphi mode) if A and B would
>> be defined in different units?
>
> This compiles in Delphi:
>
>
> {$apptype console}
>
> Type
>      TLIST<T>=class
>       end;
>
> type
>      Ta= TLIST<POINTER>;
>      TB= TLIST<POINTER>;
>
> Type
>      TC=TLIST<POINTER>;	
>
> var
>     A: TList<Pointer>;
>     B: TList<Pointer>;
>     aa : TA;
>     bb : TB;
>     cc : TC;
> begin
>     B := A;
>     aa:=a;
>     bb:=aa;
>     cc:=aa;
> end.

This should compile also in FPC (in mode Delphi). The question is about 
different units though (I will test that myself on my ride home in a few 
minutes, no worries :) )

Regards,
Sven




More information about the fpc-devel mailing list