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