Use control flow analysis for type guards · Issue #2388 · microsoft/TypeScript
TS 1.4 Type guard fails to narrow the union type when returning early. function foo(x: number | string) { if (typeof x === 'string') { return; } // x should now be a number if (2 % x !== 0) { // do...