45 lines
868 B
Text
45 lines
868 B
Text
|
=== tests/cases/compiler/checkInfiniteExpansionTermination.ts ===
|
||
|
// Regression test for #1002
|
||
|
// Before fix this code would cause infinite loop
|
||
|
|
||
|
interface IObservable<T> {
|
||
|
>IObservable : IObservable<T>
|
||
|
>T : T
|
||
|
|
||
|
n: IObservable<T[]>; // Needed, must be T[]
|
||
|
>n : IObservable<T[]>
|
||
|
>IObservable : IObservable<T>
|
||
|
>T : T
|
||
|
}
|
||
|
|
||
|
// Needed
|
||
|
interface ISubject<T> extends IObservable<T> { }
|
||
|
>ISubject : ISubject<T>
|
||
|
>T : T
|
||
|
>IObservable : IObservable<T>
|
||
|
>T : T
|
||
|
|
||
|
interface Foo { x }
|
||
|
>Foo : Foo
|
||
|
>x : any
|
||
|
|
||
|
interface Bar { y }
|
||
|
>Bar : Bar
|
||
|
>y : any
|
||
|
|
||
|
var values: IObservable<Foo>;
|
||
|
>values : IObservable<Foo>
|
||
|
>IObservable : IObservable<T>
|
||
|
>Foo : Foo
|
||
|
|
||
|
var values2: ISubject<Bar>;
|
||
|
>values2 : ISubject<Bar>
|
||
|
>ISubject : ISubject<T>
|
||
|
>Bar : Bar
|
||
|
|
||
|
values = values2;
|
||
|
>values = values2 : ISubject<Bar>
|
||
|
>values : IObservable<Foo>
|
||
|
>values2 : ISubject<Bar>
|
||
|
|