44 lines
2.3 KiB
Text
44 lines
2.3 KiB
Text
=== 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(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))
|
|
}
|
|
|