title: Default value and generics in typescript
body: <p>I'd like to create the following class:</p>
  
  <pre class="lang-js prettyprint-override"><code>class MyClass&lt;T = {}&gt; {
    constructor(private values: () =&gt; Promise&lt;T&gt; = () =&gt; Promise.resolve({})) {}
  }
  </code></pre>
  
  <p>Of course, compiler complains because type <code>T</code> is unknown and it is then impossible to assign an empty object to it:</p>
  
  <pre><code>Type '() =&gt; Promise&lt;{}&gt;' is not assignable to type '() =&gt; Promise&lt;T&gt;'.
  </code></pre>
  
  <p>But I feel it rather “dirty” to give the default method to constructor each time I create a new <code>MyClass</code> object with default <code>T</code> value.</p>
  
  <p>What would you think would be the best way write this?</p>