title: Variadic generic types in TypeScript?
body: <p>I'd like to make a function in TypeScript that takes an array of constructor functions and returns a corresponding array of instances. See code below. </p>
  
  <p>Note that the <code>getArray</code> method is wildly incorrect, it is just an attempt to convey my intent. </p>
  
  <p>Is this possible in any form or is it beyond the capabilities of TypeScript's type engine?</p>
  
  <pre><code>class T1 {}
  class T2 {}
  class T3 {}
  type AnyCon = new() =&gt; any;
  
  function getOne&lt;T_Con extends AnyCon&gt;(con: T_Con): InstanceType&lt;T_Con&gt; {
    return new con();
  }
  
  function getArray&lt;T_Cons&gt;(cons: T_Cons): InstanceType&lt;T_Cons&gt;[] {
    return cons.map( (c: con) =&gt; new con() );
  }
  
  let t1: T1 = getOne(T1);
  let [t2, t3]: [T2, T3] = getArray( [T2, T3] );
  </code></pre>