Skip to content
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

Introduce 'getTypeOfExpression' function #12396

Merged
merged 3 commits into from
Nov 22, 2016
Merged

Conversation

ahejlsberg
Copy link
Member

This PR introduces a new getTypeOfExpression function in the checker. Unlike checkExpression, this function is simply concerned with computing the type and may not fully check all contained sub-expressions for errors. In getTypeOfExpression we optimize for the common case of a call to a function with a single non-generic call signature where we can just fetch the return type without checking the arguments. Ideally, over time the entire family of checkXXX functions whould have a parameter that indicates whether full error checking is required such that we can perform more optimizations locally.

Fixes #12319. Actually, #12319 was sort of fixed by #12362, but only when --noImplicitAny is not specified. For that reason we have the flag on in the regression test.

@ahejlsberg ahejlsberg merged commit 864e179 into master Nov 22, 2016
@ahejlsberg ahejlsberg deleted the getTypeOfExpression branch November 22, 2016 23:33
@mhegazy mhegazy mentioned this pull request Nov 23, 2016
@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.

Endless waiting for 2.1.1 compiling (unuseable)
3 participants