Skip to content

Commit de20443

Browse files
committed
PR feedback
1 parent 6b29f36 commit de20443

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27335,14 +27335,12 @@ namespace ts {
2733527335

2733627336
const declCount = length(failed.declaration?.symbol.declarations);
2733727337
const isOverload = declCount > 1;
27338-
const implDecl = isOverload ? failed.declaration?.symbol.declarations[declCount - 1] : undefined;
27339-
27340-
27341-
if (isOverload && implDecl && nodeIsPresent((implDecl as FunctionLikeDeclaration).body)) {
27338+
const implDecl = isOverload ? find(failed.declaration?.symbol.declarations || emptyArray, d => nodeIsPresent((d as FunctionLikeDeclaration).body)) : undefined;
27339+
if (implDecl) {
2734227340
const candidate = getSignatureFromDeclaration(implDecl as FunctionLikeDeclaration);
2734327341
const isSingleNonGenericCandidate = !candidate.typeParameters;
27344-
if (!!chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate)) {
27345-
addRelatedInfo(diagnostic , createDiagnosticForNode(implDecl, Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible));
27342+
if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate)) {
27343+
addRelatedInfo(diagnostic, createDiagnosticForNode(implDecl, Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible));
2734627344
}
2734727345
}
2734827346

0 commit comments

Comments
 (0)