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
// getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type.
@@ -25575,6 +25584,19 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
25575
25584
priority = savePriority;
25576
25585
}
25577
25586
25587
+
// Ensure an inference action is performed only once for the given source and target types.
25588
+
// This includes two things:
25589
+
// Avoiding inferring between the same pair of source and target types,
25590
+
// and avoiding circularly inferring between source and target types.
25591
+
// For an example of the last, consider if we are inferring between source type
25592
+
// `type Deep<T> = { next: Deep<Deep<T>> }` and target type `type Loop<U> = { next: Loop<U> }`.
25593
+
// We would then infer between the types of the `next` property: `Deep<Deep<T>>` = `{ next: Deep<Deep<Deep<T>>> }` and `Loop<U>` = `{ next: Loop<U> }`.
25594
+
// We will then infer again between the types of the `next` property:
25595
+
// `Deep<Deep<Deep<T>>>` and `Loop<U>`, and so on, such that we would be forever inferring
25596
+
// between instantiations of the same types `Deep` and `Loop`.
25597
+
// In particular, we would be inferring from increasingly deep instantiations of `Deep` to `Loop`,
25598
+
// such that we would go on inferring forever, even though we would never infer
0 commit comments