diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6e35ba9f421..92807a729a5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4821,20 +4821,8 @@ namespace ts { function getInstantiatedConstructorsForTypeArguments(type: Type, typeArgumentNodes: TypeNode[], location: Node): Signature[] { const signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); - if (some(signatures)) { - const result: Signature[] = []; - const typeArguments = map(typeArgumentNodes, getTypeFromTypeNode); - for (const sig of signatures) { - if (some(sig.typeParameters)) { - result.push(getSignatureInstantiation(sig, typeArguments)); - } - else { - result.push(sig); - } - } - return result; - } - return emptyArray; + const typeArguments = map(typeArgumentNodes, getTypeFromTypeNode); + return sameMap(signatures, sig => some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments) : sig); } /**