-
Notifications
You must be signed in to change notification settings - Fork 12.8k
noUnusedLocals with allowJS and checkJS causes error #21533
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
Fixed by #21343? |
Yep! Test with latest. Closing out. |
@sandersn might be a good candidate for backporting |
It is already ported. should be released with 2.7.2 |
When will release 2.7.2? |
No specific ETA at the moment. but we plan it to go out sometime in the next two weeks. |
i think a new release containing just this bug fix would have been a good move. |
2.7.2 should be live now. |
I have the same problem with 2.8.1
|
@sebsto looks like a completely different call stack - can you open a new issue with repro steps? Thanks! |
I realized that after posting, new issue and steps to reproduce is here. #23461 |
TypeScript Version: 2.7.1
Search Terms:
checkJS, unusedlocals, tsc.js:59841
Code
Run: tsc test.js --noUnusedLocals --checkJS --allowJS --noEmit
With
Expected behavior:
No errors introduced
Actual behavior:
/usr/local/lib/node_modules/typescript/lib/tsc.js:59841
throw e;
^
Error: Debug Failure.
at checkUnusedClassMembers (/usr/local/lib/node_modules/typescript/lib/tsc.js:35757:38)
at checkUnusedIdentifiers (/usr/local/lib/node_modules/typescript/lib/tsc.js:35643:29)
at checkSourceFileWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:37913:21)
at checkSourceFile (/usr/local/lib/node_modules/typescript/lib/tsc.js:37891:13)
at getDiagnosticsWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:37945:17)
at Object.getDiagnostics (/usr/local/lib/node_modules/typescript/lib/tsc.js:37934:24)
at /usr/local/lib/node_modules/typescript/lib/tsc.js:59858:85
at runWithCancellationToken (/usr/local/lib/node_modules/typescript/lib/tsc.js:59834:24)
at getSemanticDiagnosticsForFileNoCache (/usr/local/lib/node_modules/typescript/lib/tsc.js:59848:20)
at getAndCacheDiagnostics (/usr/local/lib/node_modules/typescript/lib/tsc.js:60059:26)
Additional info:
If I remove the semi-colon from the
doSomething
method or don't pass the--noUnusedLocals
flag the error does not appear. I don't get the error in either case on TypeScript version2.6.2
. We are using allowJS/checkJS feature on our legacy JS at my shop and ran into this bug after2.7.1
upgradeThe text was updated successfully, but these errors were encountered: