title: Combine all types in array into a single type
body: <p>I have a <code>superObject()</code> function which just combined a lot of objects:</p>
  <pre class="lang-js prettyprint-override"><code>type Class&lt;T = any&gt; = {
      new(...args: any[]): T
  }
  
  function superObject&lt;C extends Class[]&gt;(...classes: C) {
      let obj = {};
      for(const klass of classes) {
          obj = {
              ...obj,
              ...new klass()
          }
      }
      return obj;
  }
  </code></pre>
  <p>There does not seem to be a good way to annotate the return type, as <code>obj</code> will have every property of every class. I have tried marking the function as returning <code>C[number]</code>, but this gives a union (<code>classes[0] | classes[1]</code>, not <code>classes[0] &amp; classes[1]</code>). How would I get this type at compile time?</p>