title: A rest parameter must be of an array type
body: <p>I have an odd error where the code below works, however the compiler is giving me an error.</p>
  
  <p>I believe <code>C</code> in <code>...args: C</code> in both spots is throwing</p>
  
  <pre><code>: A rest parameter must be of an array type. (2370)
  : A rest parameter must be of an array type. (2370)
  : Type '&lt;A extends string, B extends string, C extends any[], D&gt;(A: A, B: B, fn: (...args: C) =&gt; D) =&gt; { ...' is not assignable to type 'MakeFromTo'.
    Type '{ [x: string]: { to: { [x: string]: (...args: C) =&gt; D; }; }; }' is not assignable to type 'Record&lt;A, { to: Record&lt;B, (...args: C) =&gt; D&gt;; }&gt;'. (2322)
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>type MethodResult&lt;TFrom extends string, TTo extends string, C extends any[], D&gt; = Record&lt;TFrom, {
    to: Record&lt;TTo, (...args: C) =&gt; D&gt;;
  }&gt;;
  type MakeFromTo = &lt;A extends string, B extends string, C extends any[], D&gt; (A: A, B: B, fn: (...args: C) =&gt; D) =&gt; MethodResult&lt;A, B, C, D&gt;;
  const makeFromTo: MakeFromTo = (A, B, fn) =&gt; ({ [A]: { to: { [B]: fn } } });
  </code></pre>
  
  <p>Using typescript <code>2.6.2</code></p>