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 34 35 36 37 38 39 40 41 42 43 44
|
=== tests/cases/compiler/checkInfiniteExpansionTermination2.ts ===
// Regression test for #1002
// Before fix this code would cause infinite loop
interface IObservable<T> {
>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0))
>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 3, 22))
n: IObservable<T[]>;
>n : Symbol(IObservable.n, Decl(checkInfiniteExpansionTermination2.ts, 3, 26))
>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0))
>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 3, 22))
}
interface ISubject<T> extends IObservable<T> { }
>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination2.ts, 5, 1))
>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 6, 19))
>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0))
>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 6, 19))
declare function combineLatest<TOther>(x: IObservable<TOther>[]): void;
>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71))
>TOther : Symbol(TOther, Decl(checkInfiniteExpansionTermination2.ts, 8, 31))
>x : Symbol(x, Decl(checkInfiniteExpansionTermination2.ts, 8, 39))
>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0))
>TOther : Symbol(TOther, Decl(checkInfiniteExpansionTermination2.ts, 8, 31))
declare function combineLatest(): void;
>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71))
function fn<T>() {
>fn : Symbol(fn, Decl(checkInfiniteExpansionTermination2.ts, 9, 39))
>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 11, 12))
var values: ISubject<any>[] = [];
>values : Symbol(values, Decl(checkInfiniteExpansionTermination2.ts, 12, 7))
>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination2.ts, 5, 1))
// Hang when using <T>, but not <any>
combineLatest<T>(values);
>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71))
>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 11, 12))
>values : Symbol(values, Decl(checkInfiniteExpansionTermination2.ts, 12, 7))
}
|