title: TObjectList<T>.Contains causes Access Violation in Delphi 2009
body: <p>In Delphi 2009, I had no major problems with Generics so far (using Generics.Collections lists, with no special Generics features).</p>
  
  <p>Now I found this code will cause an AV in the line which accesses <code>MyList.Contains</code>.</p>
  
  <p>The error disappears if I declare TMyList = <code>class(TList&lt;TMyEntry&gt;)</code>;</p>
  
  <p>Should I avoid <code>TObjectList&lt;T&gt;</code> or is something else in my code causing this error?</p>
  
  <pre><code>type
    TMyEntry = class(TStringlist);
    TMyList = class(TObjectList&lt;TMyEntry&gt;);
  
  procedure TListTests.TestAV;
  var
    Entry: TMyEntry;
    MyList: TMyList;
  begin
    MyList := TMyList.Create;
    try
      Entry := TMyEntry.Create;
  
      MyList.Add(Entry);
  
      Assert(MyList.Contains(Entry));  // &lt;--- AV
  
    finally
      MyList.Free;
    end;
  end;
  </code></pre>