Skip to content

Commit 4a256ab

Browse files
Give a related span pointing to the implementation signature when reporting incompatibility.
1 parent cee933f commit 4a256ab

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24448,7 +24448,10 @@ namespace ts {
2444824448
const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
2444924449
for (const signature of signatures) {
2445024450
if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
24451-
error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature);
24451+
addRelatedInfo(
24452+
error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
24453+
createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
24454+
);
2445224455
break;
2445324456
}
2445424457
}

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,10 @@
25852585
"category": "Error",
25862586
"code": 2749
25872587
},
2588+
"The implementation signature is declared here.": {
2589+
"category": "Error",
2590+
"code": 2750
2591+
},
25882592

25892593
"Import declaration '{0}' is using private name '{1}'.": {
25902594
"category": "Error",

0 commit comments

Comments
 (0)