Skip to content

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

Merged
sheetalkamat merged 1 commit into
masterfrom
unusedIdentifierCorrectFile
May 18, 2018
Merged

Unused variable error reporting needs to handle nodes that could not belong to current source file#24234
sheetalkamat merged 1 commit into
masterfrom
unusedIdentifierCorrectFile

Conversation

@sheetalkamat
Copy link
Copy Markdown
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