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
+27-19Lines changed: 27 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -22556,15 +22556,11 @@ namespace ts {
22556
22556
inferFromTypeArguments(getTypeArguments(source as TypeReference), getTypeArguments(target as TypeReference), getVariances((source as TypeReference).target));
22557
22557
}
22558
22558
else if (source.flags & TypeFlags.Index && target.flags & TypeFlags.Index) {
22559
-
contravariant = !contravariant;
22560
-
inferFromTypes((source as IndexType).type, (target as IndexType).type);
22561
-
contravariant = !contravariant;
22559
+
inferFromContravariantTypes((source as IndexType).type, (target as IndexType).type);
inferWithPriority(empty, (target as IndexType).type, InferencePriority.LiteralKeyof);
22567
-
contravariant = !contravariant;
22563
+
inferFromContravariantTypesWithPriority(empty, (target as IndexType).type, InferencePriority.LiteralKeyof);
22568
22564
}
22569
22565
else if (source.flags & TypeFlags.IndexedAccess && target.flags & TypeFlags.IndexedAccess) {
22570
22566
inferFromTypes((source as IndexedAccessType).objectType, (target as IndexedAccessType).objectType);
@@ -22577,10 +22573,7 @@ namespace ts {
22577
22573
}
22578
22574
else if (source.flags & TypeFlags.Substitution) {
22579
22575
inferFromTypes((source as SubstitutionType).baseType, target);
22580
-
const oldPriority = priority;
22581
-
priority |= InferencePriority.SubstituteSource;
22582
-
inferFromTypes((source as SubstitutionType).substitute, target); // Make substitute inference at a lower priority
22583
-
priority = oldPriority;
22576
+
inferWithPriority((source as SubstitutionType).substitute, target, InferencePriority.SubstituteSource); // Make substitute inference at a lower priority
0 commit comments