<!-- BUGS: Please use this template. --> <!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript --> <!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md --> **TypeScript Version:** 2.5.2 **Code** ```ts function foo(): never { throw new Error() } function bar(): number { if (Math.random() > 0.5) return 1; foo(); // compiler should realise we can't get here. } ``` **Expected behavior:** Compiles without warnings when compiled with --noImplicitReturns **Actual behavior:** error TS7030: Not all code paths return a value.