46 lines
1.2 KiB
Text
46 lines
1.2 KiB
Text
=== tests/cases/compiler/checkInfiniteExpansionTermination2.ts ===
|
|
// Regression test for #1002
|
|
// Before fix this code would cause infinite loop
|
|
|
|
interface IObservable<T> {
|
|
>IObservable : IObservable<T>
|
|
>T : T
|
|
|
|
n: IObservable<T[]>;
|
|
>n : IObservable<T[]>
|
|
>IObservable : IObservable<T>
|
|
>T : T
|
|
}
|
|
interface ISubject<T> extends IObservable<T> { }
|
|
>ISubject : ISubject<T>
|
|
>T : T
|
|
>IObservable : IObservable<T>
|
|
>T : T
|
|
|
|
declare function combineLatest<TOther>(x: IObservable<TOther>[]): void;
|
|
>combineLatest : { <TOther>(x: IObservable<TOther>[]): void; (): void; }
|
|
>TOther : TOther
|
|
>x : IObservable<TOther>[]
|
|
>IObservable : IObservable<T>
|
|
>TOther : TOther
|
|
|
|
declare function combineLatest(): void;
|
|
>combineLatest : { <TOther>(x: IObservable<TOther>[]): void; (): void; }
|
|
|
|
function fn<T>() {
|
|
>fn : <T>() => void
|
|
>T : T
|
|
|
|
var values: ISubject<any>[] = [];
|
|
>values : ISubject<any>[]
|
|
>ISubject : ISubject<T>
|
|
>[] : undefined[]
|
|
|
|
// Hang when using <T>, but not <any>
|
|
combineLatest<T>(values);
|
|
>combineLatest<T>(values) : void
|
|
>combineLatest : { <TOther>(x: IObservable<TOther>[]): void; (): void; }
|
|
>T : T
|
|
>values : ISubject<any>[]
|
|
}
|
|
|