fix(49392): show optional class methods with enabled strict option (#49768)

This commit is contained in:
Oleksandr T
2022-07-19 00:49:13 +03:00
committed by GitHub
parent efbe03a33c
commit 91f7cfc501
2 changed files with 30 additions and 1 deletions

View File

@@ -138,7 +138,7 @@ namespace ts.codefix {
// If there is more than one overload but no implementation signature
// (eg: an abstract method or interface declaration), there is a 1-1
// correspondence of declarations and signatures.
const signatures = checker.getSignaturesOfType(type, SignatureKind.Call);
const signatures = type.isUnion() ? flatMap(type.types, t => t.getCallSignatures()) : type.getCallSignatures();
if (!some(signatures)) {
break;
}