|
1 | 1 | === tests/cases/compiler/circularInferredTypeOfVariable.ts === |
2 | | - |
3 | 2 | // Repro from #14428 |
4 | 3 |
|
5 | 4 | (async () => { |
6 | 5 | function foo(p: string[]): string[] { |
7 | | ->foo : Symbol(foo, Decl(circularInferredTypeOfVariable.ts, 3, 14)) |
8 | | ->p : Symbol(p, Decl(circularInferredTypeOfVariable.ts, 4, 17)) |
| 6 | +>foo : Symbol(foo, Decl(circularInferredTypeOfVariable.ts, 2, 14)) |
| 7 | +>p : Symbol(p, Decl(circularInferredTypeOfVariable.ts, 3, 17)) |
9 | 8 |
|
10 | 9 | return []; |
11 | 10 | } |
12 | 11 |
|
13 | 12 | function bar(p: string[]): string[] { |
14 | | ->bar : Symbol(bar, Decl(circularInferredTypeOfVariable.ts, 6, 5)) |
15 | | ->p : Symbol(p, Decl(circularInferredTypeOfVariable.ts, 8, 17)) |
| 13 | +>bar : Symbol(bar, Decl(circularInferredTypeOfVariable.ts, 5, 5)) |
| 14 | +>p : Symbol(p, Decl(circularInferredTypeOfVariable.ts, 7, 17)) |
16 | 15 |
|
17 | 16 | return []; |
18 | 17 | } |
19 | 18 |
|
20 | 19 | let a1: string[] | undefined = []; |
21 | | ->a1 : Symbol(a1, Decl(circularInferredTypeOfVariable.ts, 12, 7)) |
| 20 | +>a1 : Symbol(a1, Decl(circularInferredTypeOfVariable.ts, 11, 7)) |
22 | 21 |
|
23 | 22 | while (true) { |
24 | 23 | let a2 = foo(a1!); |
25 | | ->a2 : Symbol(a2, Decl(circularInferredTypeOfVariable.ts, 15, 11)) |
26 | | ->foo : Symbol(foo, Decl(circularInferredTypeOfVariable.ts, 3, 14)) |
27 | | ->a1 : Symbol(a1, Decl(circularInferredTypeOfVariable.ts, 12, 7)) |
| 24 | +>a2 : Symbol(a2, Decl(circularInferredTypeOfVariable.ts, 14, 11)) |
| 25 | +>foo : Symbol(foo, Decl(circularInferredTypeOfVariable.ts, 2, 14)) |
| 26 | +>a1 : Symbol(a1, Decl(circularInferredTypeOfVariable.ts, 11, 7)) |
28 | 27 |
|
29 | 28 | a1 = await bar(a2); |
30 | | ->a1 : Symbol(a1, Decl(circularInferredTypeOfVariable.ts, 12, 7)) |
31 | | ->bar : Symbol(bar, Decl(circularInferredTypeOfVariable.ts, 6, 5)) |
32 | | ->a2 : Symbol(a2, Decl(circularInferredTypeOfVariable.ts, 15, 11)) |
| 29 | +>a1 : Symbol(a1, Decl(circularInferredTypeOfVariable.ts, 11, 7)) |
| 30 | +>bar : Symbol(bar, Decl(circularInferredTypeOfVariable.ts, 5, 5)) |
| 31 | +>a2 : Symbol(a2, Decl(circularInferredTypeOfVariable.ts, 14, 11)) |
33 | 32 | } |
34 | 33 | }); |
0 commit comments