Skip to content

Unused variable error reporting needs to handle nodes that could not belong to current source file #24234

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

Merged
merged 1 commit into from
May 18, 2018

Conversation

sheetalkamat
Copy link
Member

When checking the sourceFile, if we encounter module import and its not yet resolved, it would go and resolve its type, resulting in checking locals of the module (which is different file than the file thats being checked. So we need to add the potentialUnused node to correct source file list.
Fixes #24215

…belong to current source file

Eg. when resolving module, the another file gets checked and its locals are added to potentiallyUnused list
Fixes #24215
@sheetalkamat sheetalkamat merged commit 3bb9ccf into master May 18, 2018
@sheetalkamat sheetalkamat deleted the unusedIdentifierCorrectFile branch May 18, 2018 20:25
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion diagnostics contain unused variables from some other file and dont make sense at all
2 participants