File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -12107,7 +12107,7 @@ namespace ts {
12107
12107
if (type.resolvedBaseConstraint) {
12108
12108
return type.resolvedBaseConstraint;
12109
12109
}
12110
- const stack: Type [] = [];
12110
+ const stack: object [] = [];
12111
12111
return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type);
12112
12112
12113
12113
function getImmediateBaseConstraint(t: Type): Type {
@@ -12122,8 +12122,9 @@ namespace ts {
12122
12122
// levels of nesting, we are presumably exploring a repeating pattern with a long cycle that hasn't
12123
12123
// yet triggered the deeply nested limiter. We have no test cases that actually get to 50 levels of
12124
12124
// 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);
12127
12128
result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false));
12128
12129
stack.pop();
12129
12130
}
You can’t perform that action at this time.
0 commit comments