[fpc-devel] potential bug, generics vs helpers

Marco van de Voort marcov at stack.nl
Fri Jan 27 17:25:45 CET 2012


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.

I tried to use "x = type a", syntax but that is not allowed for generics.



More information about the fpc-devel mailing list