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 @@ -12107,7 +12107,7 @@ namespace ts {
1210712107 if (type.resolvedBaseConstraint) {
1210812108 return type.resolvedBaseConstraint;
1210912109 }
12110- const stack: Type [] = [];
12110+ const stack: object [] = [];
1211112111 return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type);
1211212112
1211312113 function getImmediateBaseConstraint(t: Type): Type {
@@ -12122,8 +12122,9 @@ namespace ts {
1212212122 // levels of nesting, we are presumably exploring a repeating pattern with a long cycle that hasn't
1212312123 // yet triggered the deeply nested limiter. We have no test cases that actually get to 50 levels of
1212412124 // nesting, so it is effectively just a safety stop.
12125- if (stack.length < 10 || stack.length < 50 && !isDeeplyNestedType(t, stack, stack.length)) {
12126- stack.push(t);
12125+ const identity = getRecursionIdentity(t);
12126+ if (stack.length < 10 || stack.length < 50 && !contains(stack, identity)) {
12127+ stack.push(identity);
1212712128 result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false));
1212812129 stack.pop();
1212912130 }
You can’t perform that action at this time.
0 commit comments