3 Replies
AapoAlas
AapoAlas5mo ago
GitHub
Call to function returning never can not be used to narrow type · I...
TypeScript Version: 2.3.2 A function that never returns (return type never) can not be used in a type guard to narrow the type after the branch. Code class Thing { }; function diverges(): never { t...
AapoAlas
AapoAlas5mo ago
GitHub
Generalize never type handling for control flow analysis based ty...
I guess there would be some duplicates, but I cannot find it. TypeScript Version: 2.1.14 Code function throwError(): never { throw new Error(); } let foo: string | undefined; if (!foo) { throwError...
Nanashi.
Nanashi.OP5mo ago
I see; thanks!