title: Unsafe implicit conversion of generics in TypeScript
body: <p>The TypeScript compiler <code>tsc</code> compiles the following code without complaints, even with the <code>--strict</code> flag. However, the code contains a basic bug, which is prevented in languages like Java or C#.</p>
  
  <pre><code>interface IBox&lt;T&gt; {
    value: T;
  }
  
  const numberBox: IBox&lt;number&gt; = { value: 1 };
  
  function insertString(items: IBox&lt;string | number&gt;): void {
    items.value = 'Test';
  }
  
  // this call is problematic
  insertString(numberBox);
  
  // throws at runtime:
  // "TypeError: numberBox.value.toExponential is not a function"
  numberBox.value.toExponential();
  </code></pre>
  
  <p>Can <code>tsc</code> be configured so that such a bug is recognized?</p>