Skip to content

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

Merged
ahejlsberg merged 2 commits into
masterfrom
fixThisAndContextualTypes
Aug 9, 2018
Merged

Revise logic that computes the contextual type for a parameter#26244
ahejlsberg merged 2 commits into
masterfrom
fixThisAndContextualTypes

Conversation

@ahejlsberg
Copy link
Copy Markdown
Member

Fixes #26099.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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