title: Two generic functions, both passed in the same parameter but evaluated differently, why
body: <p>I have the following code of generic functions:</p>
  <pre><code>type Bar&lt;T&gt; = {bar: T}
  
  function test1&lt;T&gt;(arg: T extends {foo: number} ? T : never): void {}
  function test3&lt;T&gt;(arg: T extends {foo: number} ? Bar&lt;T&gt; : never): void {}
  </code></pre>
  <p>When I call them:</p>
  <pre><code>test1({foo: 23}); // Good!
  test3({foo: 23}); // Type 'number' is not assignable to type 'never'.
  </code></pre>
  <p>I get confused, I mean shouldn't both <code>test1(...)</code> and <code>test3(...)</code> evaluating type condition of <code>arg: T extends {foo: number}</code> to be true? I mean they have exactly the same parameters passed into the functions &amp; they have the same evaluation condition for types.</p>
  <p>In other words, Why <code>test3({foo:23})</code> falls into the <code>never</code> value for type instead of <code>Bar&lt;T&gt;</code>? I also expect the <code>test3({foo:23})</code> fail but with an error message that says expecting <code>{bar: number}</code>,  why error messages instead complains the <code>never</code> side?</p>