title: Default parameter type checking against generic type parameter in typescript
body: <pre><code>const defaultArg = (arg: {}) =&gt; ({})
  
  type Arg&lt;T&gt; = (arg: T) =&gt; T;
  type Default = Arg&lt;{}&gt;;
  
  interface Test {
    (): void;
    &lt;T&gt;(arg: Arg&lt;T&gt;): void;
  }
  
  const test: Test = &lt;T&gt;(arg: Arg&lt;T&gt; = defaultArg) =&gt; { 
    //do something
  }
  </code></pre>
  
  <p>TSError:</p>
  
  <pre><code>Type '(arg: {}) =&gt; {}' is not assignable to type 'Arg&lt;T&gt;'. Type '{}' is not assignable to type 'T'. '{}' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
  </code></pre>
  
  <p>I want to decide generic parameter passed to type <code>Arg</code> based on value of <code>arg</code>. If <code>arg</code> is undefined, I want to pass <code>{}</code> as generic parameter in type <code>Arg</code> instead of <code>T</code>.</p>