Skip to content

Give correct info for contextually typed this #11600

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

Closed
wants to merge 1 commit into from

Conversation

sandersn
Copy link
Member

Fixes #10972

This essentially undoes #9746, which only contextually typed object literal methods, but did so early, during getSignatureFromDeclaration. The compiler now contextually types everything, as it did before, but only looks for a contextual type if there is no declared this type.

After #9746, a member list request from the language service would call getSignatureFromDeclaration, but it would never get a contextual this-type, because contextual typing was only enabled for object literal methods.

This essentially undoes #9746, which only contextually typed object
literal methods, but did so early, during `getSignatureFromDeclaration`.
The compiler now contextually types everything, as it did before, but
only looks for a contextual type if there is no declared `this` type.

After #9746, a member list request from the language service would call
`getSignatureFromDeclaration`, but it would never get a contextual this-type,
because contextual typing was only enabled for object literal methods.
@mhegazy
Copy link
Contributor

mhegazy commented Oct 18, 2016

closing in favor of #11673

@mhegazy mhegazy closed this Oct 18, 2016
@mhegazy mhegazy deleted the fix-contextual-this-in-function-expressions branch November 2, 2017 21:03
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

3 participants