Skip to content

Fix get candidate for overload failure checking #36744

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 3 commits into from
Feb 12, 2020

Conversation

sandersn
Copy link
Member

Fixes user and rwc test regressions, which I didn't file a bug for.

This re-adds the missed errors and marks as used missed nodes from the
user and RWC baselines.
It was redundant with the old tests
@sandersn
Copy link
Member Author

@weswigham can you take a look? I'll assign you officially once the reviewers list loads.

function getCandidateForOverloadFailure(
node: CallLikeExpression,
candidates: Signature[],
args: readonly Expression[],
hasCandidatesOutArray: boolean,
): Signature {
Debug.assert(candidates.length > 0); // Else should not have called this.
resolveUntypedCall(node);
Copy link
Member

Choose a reason for hiding this comment

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

@sandersn do you want to consider deferring this to the end of somehow (since it just needs to happen once for errors to be reported and usage to be painted, rather than on every attempted resolution)? Like how we have checkNodeDeferred? This does fix parameter types, and looking at the baselines, the parameter types we get from deferring this may be nicer that what's here.

Like this change is what I'm proposing - it looks like it minimizes the baseline diff a lot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems reasonable. I'll give it a try.

@sandersn
Copy link
Member Author

OK, I just took your commit.

resolveUntypedCall is really more like checkCall, though I feel bad changing the name since it does return a type to some callers.

@weswigham
Copy link
Member

resolveErrorCall returns a type; resolveUntypedCall shouldn't need to afaik?

@sandersn
Copy link
Member Author

Nope, it's actually called by things like resolveTaggedTemplateExpression and its return is passed right on through.

@sandersn sandersn merged commit 01c86c7 into master Feb 12, 2020
@sandersn sandersn deleted the fix-getCandidateForOverloadFailure-checking branch February 12, 2020 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants