Declaring inherited generics with complex type constraints
<p>I have an interface with a single generic type parameter:</p>

<pre><code>public interface IDriveable&lt;T&gt; where T : ITransmission { ... }
</code></pre>

<p>I also have a class that has a type parameter that needs to be of that interface type:</p>

<pre><code>public class VehicleFactory&lt;T&gt; where T : /* ??? */
</code></pre>

<p>There is a problem here with this declaration. I can't put "IDriveable", because that has no type parameters and doesn't match the type signature of IDriveable. But I also don't want to put IDriveable&lt;U&gt; either, because then VehicleFactory has to know what <em>kind</em> of IDriveable it's getting. I want VehicleFactory to accept <em>any</em> kind of IDriveable.</p>

<p>The proposed solution a coworker had was to use:</p>

<pre><code>public class VehicleFactory&lt;T, U&gt; where T : IDriveable&lt;U&gt;
</code></pre>

<p>But I don't like this, since it's redundant. I have to say the "U" type twice:</p>

<pre><code>var factory = new VehicleFactory&lt;IDriveable&lt;AllWheelDrive&gt;, AllWheelDrive&gt;();
</code></pre>

<p>What should go in the question marks? </p>
