title: How to return subtype in overridden method of subclass in C#?
body: <p>I have a subclass with an over-ridden method that I know always returns a particular subtype of the return type declared in the base class.  If I write the code this way, it won't compile.  Since that probably doesn't make sense, let me give a code example:</p>
  
  <pre><code>class BaseReturnType { }
  class DerivedReturnType : BaseReturnType { }
  
  abstract class BaseClass {
      public abstract BaseReturnType PolymorphicMethod();
  }
  
  class DerivedClass : BaseClass {
      // Compile Error: return type must be 'BaseReturnType' to match 
      // overridden member 'BaseClass.PolymorphicMethod()'
      public override DerivedReturnType PolymorphicMethod() { 
          return new DerivedReturnType(); 
      }
  }
  </code></pre>
  
  <p>Is there any way to accomplish this in C#?  If not, what's the best way to achieve something similar?  And why isn't it allowed?  It doesn't seem to allow any logical inconsistency, since any object returned from the over-ridden method still <code>is BaseReturnType</code>.  Maybe there is something I hadn't considered though.  Or maybe the reason is technological or historical.</p>