Skip to content

tsc 2.7.1 noUnusedLocals debug failure #21901

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

Closed
jmlopez-rod opened this issue Feb 12, 2018 · 2 comments
Closed

tsc 2.7.1 noUnusedLocals debug failure #21901

jmlopez-rod opened this issue Feb 12, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@jmlopez-rod
Copy link

I found a bug in the latest release which is no longer present in your nightly builds. The only reason I convinced myself to post the bug is because the nightly build is for 2.8.0 and given that 2.7 was just released 12 days ago I do not think the nightly build will make it out any time soon.

This bug seems more fit for a patch.

TypeScript Version: 2.7.1

Search Terms: noUnusedLocals, debug failure

Code

// test.ts

export class SomeClass {
  private notInitialized: boolean;
  private initialized: any[] = [];

  doesNothing(): void {
  };
}

Expected behavior:

The behavior seen in the nightly build seems ok:

jmlopez in ~/typescript-debug$ npm install typescript@next
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
updated 1 package in 1.394s
jmlopez in ~/typescript-debug$ tsc test.ts --noUnusedLocals --noEmit
test.ts(4,11): error TS6133: 'notInitialized' is declared but its value is never read.
test.ts(5,11): error TS6133: 'initialized' is declared but its value is never read.

Actual behavior:

jmlopez in ~/typescript-debug$ npm install typescript@latest
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
updated 1 package in 1.519s
jmlopez in ~/typescript-debug$ tsc test.ts --noUnusedLocals --noEmit
/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:59841
                throw e;
                ^

Error: Debug Failure.
    at checkUnusedClassMembers (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:35757:38)
    at checkUnusedIdentifiers (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:35643:29)
    at checkSourceFileWorker (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:37913:21)
    at checkSourceFile (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:37891:13)
    at getDiagnosticsWorker (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:37945:17)
    at Object.getDiagnostics (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:37934:24)
    at /Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:59858:85
    at runWithCancellationToken (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:59834:24)
    at getSemanticDiagnosticsForFileNoCache (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:59848:20)
    at getAndCacheDiagnostics (/Users/jmlopez/typescript-debug/node_modules/typescript/lib/tsc.js:60059:26)

Related Issues: ... (not sure)

@mhegazy
Copy link
Contributor

mhegazy commented Feb 12, 2018

Duplicate of #21491, #21829, #21701, #21697 and #21533.

Fix should be in typescript@next today and in the upcoming [email protected] expected in a week or so.

@mhegazy mhegazy closed this as completed Feb 12, 2018
@mhegazy mhegazy added the Duplicate An existing issue was already created label Feb 12, 2018
@jmlopez-rod
Copy link
Author

My searching skills are very bad, sorry about that. Good to know that the fix is coming up soon.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants