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
tsc doesn't catch use of unassigned variable inside closure #32025
Comments
Since the error is caught when |
I'm not sure about #9998, I certainly didn't immediately make the connection. However, trying to work around it by allowing
made me even more confused as this doesn't get caught even when not in a closure. It seems I'm doing something wrong here. |
For that one, you need to turn on |
Thanks! I had that in my |
Variables that are never assigned are likely a bug. I can offer a lint rule to detect such variables: https://github.com/fimbullinter/wotan/blob/master/packages/mimir/docs/no-unassigned-variable.md |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
TypeScript Version: 3.6.0-dev.20190621
Search Terms:
Code
Expected behavior:
Compile time error 2454.
Actual behavior:
No error during compiling with
tsc
, runtime error instead.Playground Link:
Related Issues:
Not really, i found a bunch of bugs related to use before assign, but not this. It seems this should be a fairly obvious bug, or I'm doing something wrong.
The text was updated successfully, but these errors were encountered: