-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Unused identifier fixes #9431
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
Unused identifier fixes #9431
Conversation
@@ -4959,6 +4961,10 @@ namespace ts { | |||
// type reference in checkTypeReferenceOrExpressionWithTypeArguments. | |||
links.resolvedSymbol = symbol; | |||
links.resolvedType = type; | |||
|
|||
if (noUnusedIdentifiers && symbol !== unknownSymbol && !isInAmbientContext(node)) { | |||
symbol.hasReference = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isReferenced
?
LGTM modulo comments |
The code below gives me an error with this branch
If I change it to
|
thanks @DickvdBrink pushed a fix out in 1fa69ca. can you give this a try? |
closing and reposting as #9452 to see if travis will pick it up. |
Fixes #9402 and #9403
We defer checking function expressions and class expressions, and if we want to get the references marked correctly we need to do the reference validation after that is done.
This change refactors the unused local and parameter checking to use a list of deferred nodes to check later.
there are also some bug fixes that i ran into, like not reporting catch variable as unused, reporting unused type aliases, optional parameters, etc..