Skip to content

Revise logic that computes the contextual type for a parameter #26244

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

ahejlsberg
Copy link
Member

Fixes #26099.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just curious about one thing.


////declare function foo(cb: (this: any, x: number, y: string, z: boolean) => void): void;
////
////foo(function(this, a, ...args) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why write this is a fourslash test? Wouldn't the type baselines provide enough information to tell what the contextual type was?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem only occurred when we were hovering in to get the type -- type baselines work "top down" like the commandline compiler and do not observe the problematic behavior

@ahejlsberg ahejlsberg merged commit 20ebe1e into master Aug 9, 2018
@ahejlsberg ahejlsberg deleted the fixThisAndContextualTypes branch August 9, 2018 13:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants