title: TypeScript compiler not enforcing type parameter in implementation of generic interface?
body: <p>Consider a TypeScript interface with two implementations:</p>
  
  <pre><code>interface IFoo {}
  
  class FooA implements IFoo {}
  class FooB implements IFoo {}
  </code></pre>
  
  <p>Next, consider a generic interface that accepts an implementation of <code>IFoo</code> as type parameter:</p>
  
  <pre><code>interface IFooHandler&lt;F extends IFoo&gt; {
      handle(foo: F): string
  }
  </code></pre>
  
  <p>Now, let's implement the <code>IFooHandler</code> interface with a specific implementation of <code>IFoo</code> as a type parameter:</p>
  
  <pre><code>class FooAHandler implements IFooHandler&lt;FooA&gt; {
      handle(foo: FooB): string {
          return "Hello, Foo A!";
      }
  }
  </code></pre>
  
  <p>This compiles perfectly, using <code>tsc</code> in version 2.0.3. So here's my question: <strong>Why <em>does</em> this compile?</strong></p>
  
  <p>Note that I've used <code>FooB</code> as parameter type in the <code>FooAHandler</code>'s <code>handle()</code> function. I would assume that this code would trigger a compiler error, as the <code>IFooHandler&lt;F&gt;</code> interface prescribes that the <code>handle</code> method should accept a parameter of type <code>F</code> (so, in case of a <code>IFooHandler&lt;FooA&gt;</code>, of type <code>FooA</code> -- and <strong>not <code>FooB</code></strong>).</p>
  
  <p>I could not find anything on this behaviour in the TypeScript documentation. Is this behaviour intentional, and if so, what's the reasoning behind it? Or am I just using this feature the wrong way?</p>
  
  <hr>
  
  <p>Just for comparison, implementing the exact same example in Java (omitting the code, as it's quite similar) yields the (expected) compile error:</p>
  
  <blockquote>
    <p>FooAHandler.java:1: error FooAHandler is not abstract and does not override abstract method handle(FooA) in IFooHandler</p>
  </blockquote>