@@ -13042,13 +13042,13 @@ namespace ts {
13042
13042
return node ? node.contextualMapper : identityMapper;
13043
13043
}
13044
13044
13045
- // If the given type is an object or union type, if that type has a single signature, and if
13046
- // that signature is non-generic , return the signature. Otherwise return undefined.
13047
- function getNonGenericSignature (type: Type, node: FunctionExpression | ArrowFunction | MethodDeclaration): Signature {
13045
+ // If the given type is an object or union type with a single signature, and if that signature has at
13046
+ // least as many parameters as the given function , return the signature. Otherwise return undefined.
13047
+ function getContextualCallSignature (type: Type, node: FunctionExpression | ArrowFunction | MethodDeclaration): Signature {
13048
13048
const signatures = getSignaturesOfStructuredType(type, SignatureKind.Call);
13049
13049
if (signatures.length === 1) {
13050
13050
const signature = signatures[0];
13051
- if (!signature.typeParameters && ! isAritySmaller(signature, node)) {
13051
+ if (!isAritySmaller(signature, node)) {
13052
13052
return signature;
13053
13053
}
13054
13054
}
@@ -13099,12 +13099,12 @@ namespace ts {
13099
13099
return undefined;
13100
13100
}
13101
13101
if (!(type.flags & TypeFlags.Union)) {
13102
- return getNonGenericSignature (type, node);
13102
+ return getContextualCallSignature (type, node);
13103
13103
}
13104
13104
let signatureList: Signature[];
13105
13105
const types = (<UnionType>type).types;
13106
13106
for (const current of types) {
13107
- const signature = getNonGenericSignature (current, node);
13107
+ const signature = getContextualCallSignature (current, node);
13108
13108
if (signature) {
13109
13109
if (!signatureList) {
13110
13110
// This signature will contribute to contextual union signature
0 commit comments