title: No compile check for generics in Typescript?
body: <p>Given the following code:</p>
  
  <pre><code>interface Contract&lt;T&gt; {
  }
  
  class Deal&lt;D&gt; implements Contract&lt;D&gt; {
  }
  
  class Agreement&lt;A&gt; implements Contract&lt;A&gt; {
  }
  </code></pre>
  
  <p>I would have expected this not to compile:</p>
  
  <pre><code>let deal:Contract&lt;number&gt; = new Deal&lt;number&gt;()
  let agreement:Contract&lt;string&gt; = new Agreement&lt;string&gt;()
  
  // expects this to not compile
  agreement = deal;
  </code></pre>
  
  <p>or this</p>
  
  <pre><code>let deal:Deal&lt;number&gt; = new Deal&lt;number&gt;()
  let agreement:Agreement&lt;string&gt; = new Agreement&lt;string&gt;()
  
  // expects this to not compile
  agreement = deal;
  </code></pre>
  
  <p>But they both compile!</p>
  
  <p>Here is a playground <a href="https://www.typescriptlang.org/play/index.html?ssl=17&amp;ssc=18&amp;pln=17&amp;pc=26#code/JYOwLgpgTgZghgYwgAgMIHtxUWAPAFQD5kBvAKAF8yyEAbOAZweQBEI5bcXjgBbAB1oReEcMwxYcXYuSo16TZAEEA5lAjDReJTwFCRYtJjDYE2mZWpCwyACbtaALgkmpIAK68ARtGIBeZBAIAHdWB1wPb18ACgBKMmtkODUNAzBnY1M8BhNQFX9AkOUUzXBcHKg8wjjqAHpa5AgAD34IM2YwAAtgDvRA9BsEdAFgITJk9VKbAPsOAG46hsTZpzYOCM8fKAKg0LXOSK3q%20PrkRInUrUdVSbTy3JB85ADd4tute8rH48XkU%20bWu1kF0esC%20uBkEMRmNThcps87A45kA" rel="nofollow noreferrer">link</a> </p>
  
  <p>I would have expected that a <code>GenericOf&lt;A&gt;</code> is not the same as <code>Genericof&lt;B&gt;</code> and the compiler should not allow assigning one to the other. What am I missing here?</p>