[fpc-devel] Problem (bug?) with generics

Micha Nelissen micha at neli.hopto.org
Fri Sep 14 09:27:02 CEST 2007


Giulio Bernardi wrote:
> Sorry I made the wrong example. The problem isn't in the dereferencing 
> of the pointer,
> but in accessing record fields. Here is simpler example:

Perhaps both, because I tried to change the GetMem line to:

  constructor TGenClass.Create;
  var p : _TPRec_;
  begin
    GetMem(p,sizeof(p^));
    p^.data1:=1;

and now I had 3 compile errors :-). I think this should work, and it's a 
  bug (or both depending on point of view).

Micha



More information about the fpc-devel mailing list