How can I get TypeScript to figure that my function cannot possibly return?
<p>I have this code:</p>

<pre><code>function A(): never {
  throw new Error("fail");
}

function B(): never {
  A();
}
</code></pre>

<p>And I get this error:</p>

<pre><code>index.ts(5,36): error TS2534: A function returning 'never' cannot have a reachable end point.
</code></pre>

<p>Why am I getting this error? Obviously, <code>A</code> never returns and therefore <code>B</code> does not have a reachable end point.</p>