title: Varargs function argument of generic partial application does not type check
body: <p>I have the following combinator that converts a mutli-argument function in one that can be partially applied:</p>
  
  <pre><code>type Tuple = any[];
  
  const partial = &lt;A extends Tuple, B extends Tuple, C&gt;
    (f: (...args: (A &amp; B)[]) =&gt; C, ...args1: A) =&gt; (...args2: B) =&gt;
  //     ^^^^^^^^^^^^^^^^^^
      f(...args1, ...args2);
  
  const sum = (v: number, w: number, x: number, y: number, z: number) =&gt;
    w + w + x + y + z;
  
  partial(sum, 1, 2, 3)(4, 5);
  //      ^^^
  </code></pre>
  
  <p><a href="https://www.typescriptlang.org/play/#code/C4TwDgpgBAKgrmANtAvFAhgOxAbQLoDcAsAFBTlSkDGA9pgM7BRjoBOwAluolGgDwBBKBAAewCJgAm9WAmQAaKACFhYidNlIIigMIA+UhSgAKAGYAuEwDobbAOb1LxoQDJlASnzveeqDsU2Vvb0AIyWAt4ovsaBwQBMlkqRBmRGFKYxtqwOIQFZDnHuxKnk1HSMUPRwALa8JgBulpg1AEYQrIoA7k2t7YoiPdVtHVAgg8OKAF7j7clQnVAA1PNLUCKrIKuTxUakLOxciMZV1Yq5UHGKAMzuxgAsigCsRUA" rel="nofollow noreferrer">Playground</a></p>
  
  <p>This doesn't work, because the function argument <code>f</code> must accept various numbers of arguments without using rest syntax. Is there a way to type <code>f</code>?</p>