-
Notifications
You must be signed in to change notification settings - Fork 12.8k
try-finally block can cause 'used before assigned` error #29684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
PR #29466 solved this but it seems that the change are lost. The only versions that it works are 3.3.0-dev.20190118 and the 3.3.0-rc. Starting 3.3.0-dev.20190119 the PR changes are lost. I only test 3.3.0-dev.20190119, 3.3.0-dev.20190123 (made hours after the 3.3.0-rc), 3.3.0-dev.20190125, 3.4.0-dev.20190129 and 3.4.0-dev.20190201. // CC @weswigham |
@weswigham can you port this into |
This should be available in TypeScript 3.3.3333. |
I thought the |
I think that's too late since 3.3.3333 > 3.3.4 by (3333 - 4) = 3329 patch versions :/ |
yeah.. really strange version number.. Would be good to hear a reason for it |
Is there a funny reason for the patch version to be |
It was simply for the repeating 3s. Sorry for any confusion, though otherwise we don't expect that it'll adversely affect anything else. |
it's pretty weird that we can't have 3.3.4 now :) next version will be 3.3.3334 if it's a patch :) |
TypeScript Version: 3.3.1 - 3.4.0-dev.20190201 (inclusive)
This is not a problem in 3.3.0-rc
Search Terms:
used before being assigned, try finally
Code
Expected behavior:
No error.
Actual behavior:
Workaround:
You can avoid the error by apply the
!
operator to thelet
statement:Playground Link:
Here is the playground link.
But this does not show the problem because the playground currently uses TS 3.2.x
Related Issues:
This looks similar to #12205. But that issue has not re-appeared and this issue only occurs if there is an if-else block in the try-finally block.
The text was updated successfully, but these errors were encountered: