Fix this-type in prototype-assigned object literals#26925
Merged
Conversation
Some cases were missing from tryGetThisTypeAt. Fixes #26831
ghost
reviewed
Sep 5, 2018
| .left as PropertyAccessExpression) // x.prototype.y | ||
| .expression as PropertyAccessExpression) // x.prototype | ||
| .expression; // x | ||
| const className = getClassNameFromPrototypeMethod(container); |
There was a problem hiding this comment.
Shouldn't this code be gated by isInJavaScriptFile(node) like a later block at the bottom of tryGetThisTypeAt?
Member
Author
There was a problem hiding this comment.
Yes, and the @constructor check below as well.
|
Is there an issue open for the following problem? /** @type {Multimap} */
let m = new Multimap();
m.set("", "");This doesn't work because |
ghost
approved these changes
Sep 12, 2018
Member
Author
|
Here's the issue you found: #26885 It must have to do with type resolution because removing the type annotation makes the error go away. |
This was referenced Sep 14, 2018
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.
Some cases were missing from tryGetThisTypeAt.
Like the previous fix, the baselines still have an error because of a new bug I found: #26923. It's a regression, but it's only in noImplicitAny.
Fixes #26831