@@ -7234,8 +7234,8 @@ namespace ts {
7234
7234
function resolveIntersectionTypeMembers(type: IntersectionType) {
7235
7235
// The members and properties collections are empty for intersection types. To get all properties of an
7236
7236
// intersection type use getPropertiesOfType (only the language service uses this).
7237
- let callSignatures: ReadonlyArray< Signature> = emptyArray ;
7238
- let constructSignatures: ReadonlyArray< Signature> = emptyArray ;
7237
+ let callSignatures: Signature[] | undefined ;
7238
+ let constructSignatures: Signature[] | undefined ;
7239
7239
let stringIndexInfo: IndexInfo | undefined;
7240
7240
let numberIndexInfo: IndexInfo | undefined;
7241
7241
const types = type.types;
@@ -7257,13 +7257,22 @@ namespace ts {
7257
7257
return clone;
7258
7258
});
7259
7259
}
7260
- constructSignatures = concatenate (constructSignatures, signatures);
7260
+ constructSignatures = appendSignatures (constructSignatures, signatures);
7261
7261
}
7262
- callSignatures = concatenate (callSignatures, getSignaturesOfType(t, SignatureKind.Call));
7262
+ callSignatures = appendSignatures (callSignatures, getSignaturesOfType(t, SignatureKind.Call));
7263
7263
stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, IndexKind.String));
7264
7264
numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, IndexKind.Number));
7265
7265
}
7266
- setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
7266
+ setStructuredTypeMembers(type, emptySymbols, callSignatures || emptyArray, constructSignatures || emptyArray, stringIndexInfo, numberIndexInfo);
7267
+ }
7268
+
7269
+ function appendSignatures(signatures: Signature[] | undefined, newSignatures: readonly Signature[]) {
7270
+ for (const sig of newSignatures) {
7271
+ if (!signatures || every(signatures, s => !compareSignaturesIdentical(s, sig, /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, compareTypesIdentical))) {
7272
+ signatures = append(signatures, sig);
7273
+ }
7274
+ }
7275
+ return signatures;
7267
7276
}
7268
7277
7269
7278
/**
0 commit comments