Fix crash due to unchecked cast in addImplementationSuccessElaboration

This commit is contained in:
Wesley Wigham
2020-10-09 10:53:36 -07:00
parent f7212aa119
commit 39c2a09b1f
6 changed files with 134 additions and 1 deletions

View File

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