Allow to find all references of the 'this 'keyword#9270
Merged
4 commits merged intomasterfrom Jun 24, 2016
Merged
Conversation
src/compiler/checker.ts
Outdated
| return undefined; | ||
| } | ||
|
|
||
| //neater |
aca2d6c to
f1f82e1
Compare
| parameters: Symbol[]; // Parameters | ||
| thisType?: Type; // type of this-type | ||
| /* @internal */ | ||
| thisParameter?: Symbol; // symbol of this-type parameter |
Member
There was a problem hiding this comment.
It was never quite right to resolve thisType in getSignatureOfDeclaration so switching to a symbol is an improvement. But it means that you should remove thisType entirely and replace usages with getTypeOfSymbol(sig.thisParameter).
Member
|
Looks good except for getting rid of |
Member
|
@yuit and I discussed the removal of if (declaration.kind === SyntaxKind.Identifier && declaration.originalKeyword.kind === SytaxKind.ThisKeyword) {
return links.type = declaration.type ? getTypeFromTypeNode(declaration.type) : unknownType;
}Of course you may need to add some type assertions in there. |
src/compiler/checker.ts
Outdated
| return parameter && parameter.symbol; | ||
| } | ||
|
|
||
| function getAnnotatedAccessorThisType(accessor: AccessorDeclaration): Type | undefined { |
Author
There was a problem hiding this comment.
Linter would complain if it weren't.
Member
There was a problem hiding this comment.
I looked it up: checkAccessorDeclaration still uses it.
Member
|
👍 |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9198. Closes #9037 because we don't need to prevent renaming if it works.