title: Can't cast derived type to base abstract class with type parameter
body: <p>I have a simple factory method which provides a concrete implementation instance based on a generic type parameter provided. If the concrete classes inherit from a common abstract base class with a type parameter I cannot cast them. The compiler tells me <code>Error   2   Cannot convert type 'Car' to 'VehicleBase&lt;T&gt;'</code>. It works fine if I substitute the abstract class for an interface with the same type parameter, or if I remove the generic type parameter from the abstract class.</p>
  
  <pre><code>interface IWheel
  {
  }
  
  class CarWheel : IWheel
  {
  }
  
  abstract class VehicleBase&lt;T&gt;
  {
  }
  
  class Car : VehicleBase&lt;CarWheel&gt;
  {
  }
  
  class VehicleFactory
  {
      public static VehicleBase&lt;T&gt; GetNew&lt;T&gt;()
      {
          if (typeof(T) == typeof(CarWheel))
          {
              return (VehicleBase&lt;T&gt;)new Car();
          }
          else
          {
              throw new NotSupportedException();
          }
      }
  }
  </code></pre>
  
  <p>This fails to compile on <code>(VehicleBase&lt;T&gt;)new Car()</code>. Is this a compiler defect, or could this be a deliberate design decision to treat abstract classes and interfaces with type parameters differently?</p>
  
  <p>As a workaround I can always make the abstract class implement an interface and use this as the return value for my factory method, but I'd still like to know why this behavior is happening.</p>