addImplementationSuccessElaboration admits declarations with no symbol (#41758)

This commit is contained in:
Wesley Wigham
2020-12-01 12:19:12 -08:00
committed by GitHub
parent d0c28ab0c2
commit 2a3f5508ec
6 changed files with 122 additions and 3 deletions

View File

@@ -27483,9 +27483,9 @@ namespace ts {
const oldCandidateForArgumentArityError = candidateForArgumentArityError;
const oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
const declCount = length(failed.declaration?.symbol.declarations);
const isOverload = declCount > 1;
const implDecl = isOverload ? find(failed.declaration?.symbol.declarations || emptyArray, d => isFunctionLikeDeclaration(d) && nodeIsPresent(d.body)) : undefined;
const failedSignatureDeclarations = failed.declaration?.symbol?.declarations || emptyArray;
const isOverload = failedSignatureDeclarations.length > 1;
const implDecl = isOverload ? find(failedSignatureDeclarations, d => isFunctionLikeDeclaration(d) && nodeIsPresent(d.body)) : undefined;
if (implDecl) {
const candidate = getSignatureFromDeclaration(implDecl as FunctionLikeDeclaration);
const isSingleNonGenericCandidate = !candidate.typeParameters;