Skip to content

Fix contextual signature instantiation during type inference #640

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

Merged
merged 2 commits into from
Sep 10, 2014

Conversation

ahejlsberg
Copy link
Member

Fixes #547.

@ahejlsberg
Copy link
Member Author

Compiler now performs contextual signature instantiation during type inference for both nested and top level expressions, as specified in 4.12.2 in the spec:

  • If e is an expression of a function type that contains exactly one generic call signature and no other members, and T is a function type with exactly one non-generic call signature and no other members, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed, and e’s type is changed to a function type with e’s call signature instantiated in the context of T’s call signature (section 3.8.5).

This was only done for top level expressions before this fix.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 10, 2014

👍

ahejlsberg added a commit that referenced this pull request Sep 10, 2014
Fix contextual signature instantiation during type inference
@ahejlsberg ahejlsberg merged commit bf084f1 into master Sep 10, 2014
@ahejlsberg ahejlsberg deleted the contextualSignatureInstantiation branch September 10, 2014 01:47
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 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.

[typeBaselines] Contextual signature instantiation does not work in type argument inference
2 participants