Unnecessary error for "possibly undefined variable" after calling function returning never
#29802
Labels
Duplicate
An existing issue was already created
never
#29802
I'm not sure if there's already an issue for this because I wasn't really sure how to describe it (hence the poor title). Given this code:
TypeScript (3.3.1) reports that
someVar
may be undefined on the last line. However it knows thatprocess.exit
returnsnever
so it seems like it could know better. If I addthrow
on the line afterprocess.exit
then the error goes away, so I guess there is some capability to know the code can never execute that applies tothrow
but not when calling functions that returnnever
.The text was updated successfully, but these errors were encountered: