Skip to content

Commit 80f523c

Browse files
committed
Change depth limit from 10 to 5 in isDeeplyNestedGeneric
1 parent 9f26803 commit 80f523c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4801,14 +4801,14 @@ module ts {
48014801
// some level beyond that.
48024802
function isDeeplyNestedGeneric(type: Type, stack: Type[], depth: number): boolean {
48034803
// We track type references (created by createTypeReference) and instantiated types (created by instantiateType)
4804-
if (type.flags & (TypeFlags.Reference | TypeFlags.Instantiated) && depth >= 10) {
4804+
if (type.flags & (TypeFlags.Reference | TypeFlags.Instantiated) && depth >= 5) {
48054805
let symbol = type.symbol;
48064806
let count = 0;
48074807
for (let i = 0; i < depth; i++) {
48084808
let t = stack[i];
48094809
if (t.flags & (TypeFlags.Reference | TypeFlags.Instantiated) && t.symbol === symbol) {
48104810
count++;
4811-
if (count >= 10) return true;
4811+
if (count >= 5) return true;
48124812
}
48134813
}
48144814
}

0 commit comments

Comments
 (0)