Compiler reports used before assigned
after try...finally
block
#12205
Milestone
used before assigned
after try...finally
block
#12205
TypeScript Version: nightly (2.1.0-dev.20161112), --stricNullChecks
Note: this code compiles under 2.0.9
Code
Expected behavior:
The code should compile. As #9260 (comment) goes, the
try ... finally ...
is a grammatical construct. IfsomeOperation
breaks the control flow, code after try-finally block will not be reachable. Soresult
after block must be assigned.Actual behavior:
Error as commented.
Related issues:
I have found a lot flow related issues. But they are more about closure/function declaration than try-catch-finally. So I think this is not a duplicate.
The text was updated successfully, but these errors were encountered: