File: checkInfiniteExpansionTermination2.types

package info (click to toggle)
node-typescript 2.1.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 203,960 kB
  • sloc: sh: 11; makefile: 5
file content (46 lines) | stat: -rw-r--r-- 1,181 bytes parent folder | download | duplicates (2)
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
45
46
=== 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>[]
}