title: Typescript generics : not assignable to type T
body: <p>Here's my code :</p>
  
  <pre><code>interface IDoc {
    doSomething(): void
  }
  
  class IDocFoo implements IDoc {
    doSomething(): void {
      console.log('Do doSomething');
    }
  }
  
  class IDocFactory {
    getIDocInstance&lt;T extends IDoc&gt;(): T {
      return new IDocFoo();
    }
  }
  </code></pre>
  
  <p>This code is reduced version of my code, of course. </p>
  
  <p>Typescript shows me an error : <code>Type 'IDocFoo' is not assignable to type 'T'</code> and I don't understand why. Is anybody can explain me why ?</p>