title: Why am I getting E2531 "Method requires explicit type argument"
body: <p>The code below relies pretty heavily on generics, and I think exposes a bug in the generics handling. But maybe there is simply something I don't understand.</p>
  
  <p>The compiler raises the error: </p>
  
  <pre>
  E2531 Method 'CreateBaseItem' requires explicit type arguments
  </pre>
  
  <p>on the line:</p>
  
  <pre><code>foo3 := TFactory.CreateBaseItem&lt;TDescendentFunctionsGroup2.Select&gt;;
  </code></pre>
  
  <p>yet as far as I can tell, instantiating <code>foo1</code> through <code>foo4</code> should all be essentially identical. This complete program highlights the issue:</p>
  
  <pre><code>program SO53568763;
  
  type
    TBaseItem = class(TInterfacedObject);
  
    IListableItem&lt;T&gt; = interface
      ['{6FD07ACB-04BB-4BFC-A38C-9B98F86DBC25}']
    end;
  
    TSomeDescendent = class(TBaseItem, IListableItem&lt;TSomeDescendent&gt;)
    end;
  
    TSelectFunctionsGenerator&lt;T: TBaseItem, IListableItem&lt;T&gt;&gt; = class(TBaseItem)
    end;
  
    TFunctionsGroup&lt;T: TBaseItem, IListableItem&lt;T&gt;&gt; = class
    public
      type
        Select = TSelectFunctionsGenerator&lt;T&gt;;
    end;
  
    TDescendentFunctionsGroup1 = class(TFunctionsGroup&lt;TSomeDescendent&gt;);
    TDescendentFunctionsGroup2 = TFunctionsGroup&lt;TSomeDescendent&gt;;
  
    TFactory = class
    public
      class function CreateBaseItem&lt;T: TBaseItem&gt;: T;
    end;
  
  class function TFactory.CreateBaseItem&lt;T&gt;;
  begin
  end;
  
  procedure Foo;
  var
    foo: TSelectFunctionsGenerator&lt;TSomeDescendent&gt;;
    foo1: TFunctionsGroup&lt;TSomeDescendent&gt;.Select;
    foo2: TDescendentFunctionsGroup1.Select;
    foo3: TDescendentFunctionsGroup2.Select;
  begin
    foo := TFactory.CreateBaseItem&lt;TSelectFunctionsGenerator&lt;TSomeDescendent&gt;&gt;;
    foo1 := TFactory.CreateBaseItem&lt;TFunctionsGroup&lt;TSomeDescendent&gt;.Select&gt;;
    foo2 := TFactory.CreateBaseItem&lt;TDescendentFunctionsGroup1.Select&gt;;
    foo3 := TFactory.CreateBaseItem&lt;TDescendentFunctionsGroup2.Select&gt;;
  end;
  
  begin
  end.
  </code></pre>
  
  <p>It is strange that <code>TDescendentFunctionsGroup2.Select</code> is explicit enough to declare a variable of that type, but not explicit enough to use as the generic argument to <code>CreateBaseItem</code>.</p>