File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -12063,7 +12063,7 @@ namespace ts {
1206312063 if (type.resolvedBaseConstraint) {
1206412064 return type.resolvedBaseConstraint;
1206512065 }
12066- const stack: Type [] = [];
12066+ const stack: object [] = [];
1206712067 return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type);
1206812068
1206912069 function getImmediateBaseConstraint(t: Type): Type {
@@ -12078,8 +12078,9 @@ namespace ts {
1207812078 // levels of nesting, we are presumably exploring a repeating pattern with a long cycle that hasn't
1207912079 // yet triggered the deeply nested limiter. We have no test cases that actually get to 50 levels of
1208012080 // nesting, so it is effectively just a safety stop.
12081- if (stack.length < 10 || stack.length < 50 && !isDeeplyNestedType(t, stack, stack.length)) {
12082- stack.push(t);
12081+ const identity = getRecursionIdentity(t);
12082+ if (stack.length < 10 || stack.length < 50 && !contains(stack, identity)) {
12083+ stack.push(identity);
1208312084 result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false));
1208412085 stack.pop();
1208512086 }
You can’t perform that action at this time.
0 commit comments