title: Typescript treats boolean like true | false when strictNullCheck is off
body: <p>I am having the following typescript code:</p>
  
  <pre><code>type PossiblePromise&lt;T&gt; = T extends Promise&lt;infer U&gt;
    ? T | U
    : T | Promise&lt;T&gt;;
  type Z = PossiblePromise&lt;boolean&gt;;
  
  const a = "a"
  const f: () =&gt; Z = () =&gt; Promise.resolve(!!a);
  </code></pre>
  
  <p>With <code>strictNullChecks</code> set to false.</p>
  
  <p>The resulting type <code>Z</code> is <code>boolean | Promise&lt;false&gt; | Promise&lt;true&gt;</code>, but I would expect it to be <code>boolean | Promise&lt;boolean&gt;</code>. So last line produces an error:</p>
  
  <pre><code>Type 'Promise&lt;boolean&gt;' is not assignable to type 'boolean | Promise&lt;false&gt; | Promise&lt;true&gt;'.
    Type 'Promise&lt;boolean&gt;' is not assignable to type 'Promise&lt;false&gt;'.
      Type 'boolean' is not assignable to type 'false'.(2322)
  input.ts(7, 10): The expected type comes from the return type of this signature.
  </code></pre>
  
  <p>Any ideas why typescript behaves like this treating <code>boolean</code> as <code>true | false</code> which should not be the case with strictNullChecks off.</p>
  
  <p>How is it possible to achieve <code>PossiblePromise&lt;T&gt;</code> type that works with boolean correctly?</p>
  
  <p><a href="https://www.typescriptlang.org/play/?strictNullChecks=false&amp;ssl=6&amp;ssc=1&amp;pln=7&amp;pc=47#code/C4TwDgpgBACg9gZwQSwEYBsIwE5wLbIIQA8AKgHxQC8UpUEAHsBAHYAmCsuBRxyLAMwjYoAVXIBYAFBQoAflpQAPmOmyAXIpU58hEhQDc00JCgAtarEQoMWbnuKo4cTAEMW5I1OkBjOCwRgKFdLACJXUN9-QKgBTQAKAEpqSgsaJJSuXSIAOmwIBBcANwh4gEIy10SDIA" rel="nofollow noreferrer">https://www.typescriptlang.org/play/?strictNullChecks=false&amp;ssl=6&amp;ssc=1&amp;pln=7&amp;pc=47#code/C4TwDgpgBACg9gZwQSwEYBsIwE5wLbIIQA8AKgHxQC8UpUEAHsBAHYAmCsuBRxyLAMwjYoAVXIBYAFBQoAflpQAPmOmyAXIpU58hEhQDc00JCgAtarEQoMWbnuKo4cTAEMW5I1OkBjOCwRgKFdLACJXUN9-QKgBTQAKAEpqSgsaJJSuXSIAOmwIBBcANwh4gEIy10SDIA</a></p>