[fpc-devel] Errors using generics - what is wrong?

Vincent Snijders vsnijders at vodafonevast.nl
Tue Oct 6 22:41:23 CEST 2009


Žilvinas Ledas schreef:
> Hello all,
> 
> I am trying to use generics but compilation fails.
> Whan I try to use unit with my generic class in my real project I get 
> "Fatal: Internal error 200204175" error.
> When I try to use it in empty Lazarus application (Unit1.pas) and I put
> -----
> procedure TForm1.Button1Click(Sender: TObject);
> var
>  lst:  specialize TTwoValuesList<UnicodeString>;
> begin
> end;
> -----
> I get these errors:
> -----

I would try to use a named type:
type
   TTwoUnicodeValuesList = specialize TTwoValuesList<UnicodeString>;

procedure TForm1.Button1Click(Sender: TObject);
var
  lst:  TTwoUnicodeValuesList;
begin
end;

Vincent



More information about the fpc-devel mailing list