How to set a forward declaration with generic types under Delphi 2010?

You can work around it by declaring an ancestor class:

type
  TBaseElement = class
  end;

  TMyCollection<T: TBaseElement> = class
  end;

  TMyElement = class(TBaseElement)
  private
    FParent: TMyCollection<TBaseElement>;
  end;

Leave a Comment