title: Delphi: How to add a different constructor to a descendant?
body: <p><strong>Update:</strong> The example i originally had was kind of complex. Here's a simple 8 line example that explains everything in one code block. The following <strike>does not compile</strike> gives a warning:</p>
  
  <pre><code>TComputer = class(TObject)
  public
      constructor Create(Cup: Integer); virtual;
  end;
  
  TCellPhone = class(TComputer)
  public
      constructor Create(Cup: Integer; Teapot: string); virtual;
  end;
  </code></pre>
  
  <p><strong>Note:</strong> This question is part 3 in my ongoing series of questions about the subtlties of constructors in Delphi</p>
  
  <h2>Original question</h2>
  
  <p>How can i add a constructor to an existing class? </p>
  
  <p>Let's give an hypothetical example (i.e. one that i'm typing up in here in the SO editor so it may or may not compile):</p>
  
  <pre><code>TXHTMLStream = class(TXMLStream)
  public
     ...
  end;
  </code></pre>
  
  <p>Further assume that the normal use of <code>TXHTMLStream</code> involved performing a lot of repeated code before it can be used:</p>
  
  <pre><code>var
     xs: TXHTMLStream;
  begin
     xs := TXHTMLStream.Create(filename);
     xs.Encoding := UTF32;
     xs.XmlVersion := 1.1;
     xs.DocType := 'strict';
     xs.PreserveWhitespace := 'true';
     ...
  
     xs.Save(xhtmlDocument);
  </code></pre>
  
  <p>Assume that i want to create a constructor that simplifies all that boilerplate setup code:</p>
  
  <pre><code>TXHTMLStream = class(TXMLStream)
  public
      constructor Create(filename: string; Encoding: TEncoding); virtual;
  end;
  
  constructor TXHTMLStream.Create(filename: string; Encoding: TEncoding);
  begin
     inherited Create(filename);
     xs.Encoding := Encoding;
     xs.XmlVersion := 1.1;
     xs.DocType := 'strict';
     xs.PreserveWhitespace := True;
     ...
  end;
  </code></pre>
  
  <p>That simplifies usage of the object to:</p>
  
  <pre><code>var
     xs: TXHTMLStream;
  begin
     xs := TXHTMLStream.Create(filename, UTF32);
     xs.Save(xhtmlDocument);
  </code></pre>
  
  <p>Except now Delphi complains that my new constructor hides the old constructor. </p>
  
  <blockquote>
    <p>Method 'Create' hides virtual method of base type 'TXMLStream'</p>
  </blockquote>
  
  <p>i certainly didn't <strong><em>mean</em></strong> to hide the ancestor create - i <strong><em>want</em></strong> both.</p>
  
  <p>How do i add a constructor (with a <em>different</em> signature) to a descendant class, while keeping the ancestor constructor so it can still be used?</p>