Skip to content

Commit fc16330

Browse files
committed
Minor changes
1 parent 95bf71f commit fc16330

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6654,9 +6654,8 @@ namespace ts {
66546654
// interface is instantiated with a fresh set of cloned type parameters (which we need to handle scenarios
66556655
// where different generations of the same type parameter are in scope). This leads to a lot of new type
66566656
// identities, and potentially a lot of work comparing those identities, so here we create an instantiation
6657-
// that reverts back to the original type identities for all unconstrained type parameters.
6658-
const canonicalTypeArguments = map(signature.typeParameters, tp => tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp);
6659-
return instantiateSignature(signature, createTypeMapper(signature.typeParameters, canonicalTypeArguments), /*eraseTypeParameters*/ true);
6657+
// that uses the original type identities for all unconstrained type parameters.
6658+
return getSignatureInstantiation(signature, map(signature.typeParameters, tp => tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp));
66606659
}
66616660

66626661
function getOrCreateTypeFromSignature(signature: Signature): ObjectType {
@@ -8493,8 +8492,8 @@ namespace ts {
84938492
return Ternary.False;
84948493
}
84958494

8496-
target = getCanonicalSignature(target);
8497-
if (source.typeParameters) {
8495+
if (source.typeParameters && source.typeParameters !== target.typeParameters) {
8496+
target = getCanonicalSignature(target);
84988497
source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes);
84998498
}
85008499

0 commit comments

Comments
 (0)