|
| 1 | +=== tests/cases/compiler/noExcessiveStackDepthError.ts === |
| 2 | +// Repro from #46631 |
| 3 | + |
| 4 | +interface FindOperator<T> { |
| 5 | +>FindOperator : Symbol(FindOperator, Decl(noExcessiveStackDepthError.ts, 0, 0)) |
| 6 | +>T : Symbol(T, Decl(noExcessiveStackDepthError.ts, 2, 23)) |
| 7 | + |
| 8 | + foo: T; |
| 9 | +>foo : Symbol(FindOperator.foo, Decl(noExcessiveStackDepthError.ts, 2, 27)) |
| 10 | +>T : Symbol(T, Decl(noExcessiveStackDepthError.ts, 2, 23)) |
| 11 | +} |
| 12 | + |
| 13 | +type FindConditions<T> = { |
| 14 | +>FindConditions : Symbol(FindConditions, Decl(noExcessiveStackDepthError.ts, 4, 1)) |
| 15 | +>T : Symbol(T, Decl(noExcessiveStackDepthError.ts, 6, 20)) |
| 16 | + |
| 17 | + [P in keyof T]?: FindConditions<T[P]> | FindOperator<FindConditions<T[P]>>; |
| 18 | +>P : Symbol(P, Decl(noExcessiveStackDepthError.ts, 7, 5)) |
| 19 | +>T : Symbol(T, Decl(noExcessiveStackDepthError.ts, 6, 20)) |
| 20 | +>FindConditions : Symbol(FindConditions, Decl(noExcessiveStackDepthError.ts, 4, 1)) |
| 21 | +>T : Symbol(T, Decl(noExcessiveStackDepthError.ts, 6, 20)) |
| 22 | +>P : Symbol(P, Decl(noExcessiveStackDepthError.ts, 7, 5)) |
| 23 | +>FindOperator : Symbol(FindOperator, Decl(noExcessiveStackDepthError.ts, 0, 0)) |
| 24 | +>FindConditions : Symbol(FindConditions, Decl(noExcessiveStackDepthError.ts, 4, 1)) |
| 25 | +>T : Symbol(T, Decl(noExcessiveStackDepthError.ts, 6, 20)) |
| 26 | +>P : Symbol(P, Decl(noExcessiveStackDepthError.ts, 7, 5)) |
| 27 | + |
| 28 | +}; |
| 29 | + |
| 30 | +function foo<Entity>() { |
| 31 | +>foo : Symbol(foo, Decl(noExcessiveStackDepthError.ts, 8, 2)) |
| 32 | +>Entity : Symbol(Entity, Decl(noExcessiveStackDepthError.ts, 10, 13)) |
| 33 | + |
| 34 | + var x: FindConditions<any>; |
| 35 | +>x : Symbol(x, Decl(noExcessiveStackDepthError.ts, 11, 7), Decl(noExcessiveStackDepthError.ts, 12, 7)) |
| 36 | +>FindConditions : Symbol(FindConditions, Decl(noExcessiveStackDepthError.ts, 4, 1)) |
| 37 | + |
| 38 | + var x: FindConditions<Entity>; // Excessive stack depth error not expected here |
| 39 | +>x : Symbol(x, Decl(noExcessiveStackDepthError.ts, 11, 7), Decl(noExcessiveStackDepthError.ts, 12, 7)) |
| 40 | +>FindConditions : Symbol(FindConditions, Decl(noExcessiveStackDepthError.ts, 4, 1)) |
| 41 | +>Entity : Symbol(Entity, Decl(noExcessiveStackDepthError.ts, 10, 13)) |
| 42 | +} |
| 43 | + |
0 commit comments