You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+26-18Lines changed: 26 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -22562,15 +22562,11 @@ namespace ts {
22562
22562
inferFromTypeArguments(getTypeArguments(source as TypeReference), getTypeArguments(target as TypeReference), getVariances((source as TypeReference).target));
22563
22563
}
22564
22564
else if (source.flags & TypeFlags.Index && target.flags & TypeFlags.Index) {
22565
-
contravariant = !contravariant;
22566
-
inferFromTypes((source as IndexType).type, (target as IndexType).type);
22567
-
contravariant = !contravariant;
22565
+
inferFromContravariantTypes((source as IndexType).type, (target as IndexType).type);
inferWithPriority(empty, (target as IndexType).type, InferencePriority.LiteralKeyof);
22573
-
contravariant = !contravariant;
22569
+
inferFromContravariantTypesWithPriority(empty, (target as IndexType).type, InferencePriority.LiteralKeyof);
22574
22570
}
22575
22571
else if (source.flags & TypeFlags.IndexedAccess && target.flags & TypeFlags.IndexedAccess) {
22576
22572
inferFromTypes((source as IndexedAccessType).objectType, (target as IndexedAccessType).objectType);
@@ -22583,10 +22579,7 @@ namespace ts {
22583
22579
}
22584
22580
else if (source.flags & TypeFlags.Substitution) {
22585
22581
inferFromTypes((source as SubstitutionType).baseType, target);
22586
-
const oldPriority = priority;
22587
-
priority |= InferencePriority.SubstituteSource;
22588
-
inferFromTypes((source as SubstitutionType).substitute, target); // Make substitute inference at a lower priority
22589
-
priority = oldPriority;
22582
+
inferWithPriority((source as SubstitutionType).substitute, target, InferencePriority.SubstituteSource); // Make substitute inference at a lower priority
0 commit comments