CFA: control flow for switch
is defeated by outer if-else
#11572
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
TypeScript Version: nightly (2.1.0-dev.20161012)
Code
Expected behavior:
Both functions succeed.
Actual behavior:
a.ts(10,19): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
If I remove the
else
keyword (which makes an equivalent program), it compiles without errors.If I put an
e
access under theswitch
, I see(parameter) e: never
on hover, so that part is working.The text was updated successfully, but these errors were encountered: