title: Create generic class or interface with self typed parameters in children classes
body: <p>I'd like to create a class or interface that I could subclass, always using current class instances as methods parameters...</p>
  
  <p>Here is an example to explain my problem:</p>
  
  <pre><code> type IArithmeticObject = interface(IInterface)
     procedure assign(ao : IArithmeticObject);
     procedure add(ao : IArithmeticObject);
     procedure remove(ao : IArithmeticObject);
     procedure multiply(ao : IArithmeticObject);
     procedure divide(ao : IArithmeticObject);
   end;
  </code></pre>
  
  <p>the interface <code>IArithmeticObject</code> whould be the starting point, referencing basic arithmetic operations and child classes could be declared as</p>
  
  <pre><code> type TInteger = class(TInterfacedObject, IArithmeticObject)
     procedure assign(ao : TInteger);
     procedure add(ao : TInteger);
     procedure remove(ao : TInteger);
     procedure multiply(ao : TInteger);
     procedure divide(ao : TInteger);
   end;
  </code></pre>
  
  <p>with parameter type for <code>ao</code> being <code>TInteger</code> and not <code>IArithmeticObject</code>.</p>
  
  <p>Another idea would be to use a self referencing generic type like:</p>
  
  <pre><code>  AMathObject = class;
  
    AMathObject&lt;T : AMathObject, constructor&gt; = class
      procedure assign(ao : T);virtual;abstract;
      procedure add(ao : T);virtual;abstract;
      procedure remove(ao : T);virtual;abstract;
      procedure multiply(ao : T);overload;virtual;abstract;
      procedure divide(ao : T);virtual;abstract;
    end;
  </code></pre>
  
  <p>but I could not figure out the right syntax... </p>
  
  <p>Does anyone have any ideas about this possibility (or impossibility)?</p>