title: Delphi - Interface inheritance with generics
body: <p>I am currently stuck with a compiling error, no one in our company can help and I am sadly not finding the correct search patterns for SO or google. </p>
  
  <p>As code I am using 2 Interfaces, inherited and 2 Classes, inherited.
  The following code reproduces the error:</p>
  
  <pre><code>program Project22;
  
  {$APPTYPE CONSOLE}
  type
    IStorageObject = interface(IInterface)
    end;
    TObjectStorage&lt;T: IStorageObject&gt; = class(TObject)
    end;
    IKeyStorageObject&lt;TKey&gt; = interface(IStorageObject)
    end;
    TKeyObjectStorage&lt;TKey, T: IKeyStorageObject&lt;TKey&gt;&gt; = class(TObjectStorage&lt;T&gt;)
    end;
    TImplementingClass&lt;TKey&gt; = class(TInterfacedObject, IKeyStorageObject&lt;TKey&gt;)
    end;
  begin
    TKeyObjectStorage&lt;Integer, TImplementingClass&lt;Integer&gt;&gt;.Create;
  end.
  </code></pre>
  
  <p>The compiler error for 'TKeyObjectStorage' is:</p>
  
  <blockquote>
    <p>[DCC Error] Project22.dpr(11): E2514 Type parameter 'T' must support interface 'IStorageObject'</p>
  </blockquote>
  
  <p>What I think is, that the compiler is not recognizing that Parameter T of the Class 'TKeyObjectStorage' correctly. 
  It should be correct, since the wanted Type 'IKeyStorageObject' has the parent type IStorageObject.</p>
  
  <p>Why is this not working? What am I doing wrong? Is this not possible in Delphi?</p>