title: Typescript function can return Promise<any> as Promise<Bar>?
body: <p>I'm creating a type-safe wrapper for the fetch-api, and I noticed that the typescript compiler classifies this as perfectly valid code:</p>
  
  <pre class="lang-js prettyprint-override"><code>function foo(response: Response): Promise&lt;Bar&gt; { //response received from a fetch() call
      const json: Promise&lt;any&gt; = response.json();
      return json; //Promise&lt;any&gt; can be returned as Promise&lt;Bar&gt;?
  }
  </code></pre>
  
  <p>Why is it possible to directly return a <code>Promise&lt;any&gt;</code> as <code>Promise&lt;Bar&gt;</code>? Shouldn't this require some kind of type assertion?</p>