title: Generics and TObject based T issue
body: <p>I have base class</p>
  
  <pre><code>  TWMapObject = class (TObject)
    private
      AFname: string;
      FFileHandler: TWMapFileHandler;
      function TryOpenFileHandler(const fName: string): TWMapFileHandler;
    public
      property FileHandler: TWMapFileHandler read FFileHandler;
      constructor Create(const fName: string);
      destructor Destroy; override;
    end;
  </code></pre>
  
  <p>ancestor</p>
  
  <pre><code>  TBlpTexture = class (TWMapObject)
    public
      width, height: integer;
      id: GLuint;
      hdr: TBLP2Header;
      constructor Create(const fname: string);
      destructor Destroy; override;
      procedure LoadBlp;
    end;
  </code></pre>
  
  <p>and T based manager</p>
  
  <pre><code>  TWMapObjectClass = class of TWMapObject;
  
    TWMapObjectManager&lt;T: TWMapObject, constructor&gt; = class
    type
      PManagerRec = ^TManagerRec;
  
      TManagerRec = record
        obj: T;
        ref: integer;
      end;
    private
      ht: TDictionary&lt;string, PManagerRec&gt;;
      function CreateNewT(const fName: string): T;
    public
      constructor Create;
      destructor Destroy; override;
      procedure Add(const fName: string);
      procedure Remove(const fName: string);
      procedure Clear;
      function Get(const fName: string): T;
    end;
  </code></pre>
  
  <p>I want to use <code>TWMapObject</code> based classes as generic parameter <code>T</code>, for that helper function</p>
  
  <pre><code>function TWMapObjectManager&lt;T&gt;.CreateNewT(const fName: string): T;
  var
    obj: TWMapObject;
    ct: TWMapObjectClass;
  begin
    ct := TWMapObjectClass(GetTypeData(TypeInfo(T)).ClassType);
    obj := ct.Create(fName);
    Move(obj, result, SizeOf(pointer));
  end;
  </code></pre>
  
  <p>called from</p>
  
  <pre><code>procedure TWMapObjectManager&lt;T&gt;.Add(const fName: string);
  var
    pr: PManagerRec;
  begin
    if ht.TryGetValue(fName, pr) then
        inc(pr.ref)
    else begin
      GetMem(pr, sizeof(TManagerRec));
      pr.obj := CreateNewT(fName);
      pr.ref := 1;
      ht.Add(fName, pr);
    end
  end;
  </code></pre>
  
  <p>and manager object created as <code>TexManager: TWMapObjectManager&lt;TBlpTexture&gt;</code>. That code was working for <code>TControl</code> based objects like <code>TButton</code> etc and created exact <code>TButton</code> for example in prevous project</p>
  
  <pre><code>class function TLuaClassTemplate&lt;T&gt;.CreateNewT(AOwner: TComponent): T;
  var
    Ctl: TControl;
  begin
    Ctl := TControlClass(GetTypeData(TypeInfo(T)).ClassType).Create(AOwner);
    Move(Ctl, result, SizeOf(pointer));
  end;
  </code></pre>
  
  <p>With TWMapObject I see <code>TBlpTexture</code> as value of ct, but called only constructor of <code>TWMapObject</code> instead of <code>TBlpTexture</code>. Am I doing something wrong? Can it be fixed?</p>