Properly handle typeof this.xxx in isTypeParameterPossiblyReferenced#54208
Properly handle typeof this.xxx in isTypeParameterPossiblyReferenced#54208ahejlsberg merged 3 commits intomainfrom
typeof this.xxx in isTypeParameterPossiblyReferenced#54208Conversation
| return some(firstIdentifierSymbol.declarations, idDecl => isNodeDescendantOf(idDecl, tpScope)) || | ||
| some((node as TypeQueryNode).typeArguments, containsReference); | ||
| if (!isThisIdentifier(firstIdentifier)) { // Don't attempt to analyze typeof this.xxx | ||
| const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier); |
There was a problem hiding this comment.
Just out of curiosity, where/why do things go wrong if firstIdentifier is this? Is it in this call to getResolvedSymbol?
There was a problem hiding this comment.
Yes, it goes wrong because this is never actually a symbol you can look up. In expressions, this isn't even an identifier, it's encoded as a ThisExpression AST node. However, a type query stores the dotted name as an EntityName, and in those this is just an identifier.
|
@typescript-bot test this |
|
Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at e67193d. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the extended test suite on this PR at e67193d. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at e67193d. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at e67193d. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based top-repos suite on this PR at e67193d. You can monitor the build here. Update: The results are in! |
|
@ahejlsberg Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
|
@ahejlsberg Here they are:Comparison Report - main..54208
System
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@ahejlsberg Here are the results of running the top-repos suite comparing Everything looks good! |
|
Hey @ahejlsberg, the results of running the DT tests are ready. |
|
@typescript-bot cherry-pick this to release-5.1 |
|
Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into |
|
Hey @DanielRosenwasser, I've opened #54413 for you. |
…e-5.1 (#54413) Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
This PR fixes a defect in the logic introduced by #50070. Specifically, that logic wasn't properly handling type queries of the form
typeof this.xxx.Fixes #54167.