title: Extracting inner generic type of union returning unknown
body: <p>I am trying to extract the generic type of a union, but I get unknown.
  However, if I explicitly try to extract (check code below), it returns the type correctly. Why? And how can I extract the type generically?</p>
  <pre><code>'use strict';
  
  type  error = {
      tag: 'error',
      error: string
  }
  
  type success&lt;T&gt; = {
      tag: 'success',
      value: T
  }
  
  type Either&lt;T&gt; =  error | success&lt;T&gt;;
  
  type extractGeneric&lt;Type&gt; = Type extends Either&lt;infer X&gt; ? X : never
  
  
  type innerType = extractGeneric&lt;Either&lt;number&gt;&gt;; // type is unknown
  type innerType2 = Either&lt;number&gt; extends Either&lt;infer X&gt; ? X : never; // type is number
  </code></pre>