55 lines
972 B
Text
55 lines
972 B
Text
=== tests/cases/compiler/infinitelyExpandingTypes3.ts ===
|
|
interface List<T> {
|
|
>List : List<T>
|
|
>T : T
|
|
|
|
data: T;
|
|
>data : T
|
|
>T : T
|
|
|
|
next: List<T>; // will be recursive reference when OwnerList is expanded
|
|
>next : List<T>
|
|
>List : List<T>
|
|
>T : T
|
|
|
|
owner: OwnerList<T>;
|
|
>owner : OwnerList<T>
|
|
>OwnerList : OwnerList<U>
|
|
>T : T
|
|
}
|
|
|
|
interface OwnerList<U> extends List<List<U>> {
|
|
>OwnerList : OwnerList<U>
|
|
>U : U
|
|
>List : List<T>
|
|
>List : List<T>
|
|
>U : U
|
|
|
|
name: string;
|
|
>name : string
|
|
}
|
|
|
|
interface OwnerList2<U> extends List<List<U>> {
|
|
>OwnerList2 : OwnerList2<U>
|
|
>U : U
|
|
>List : List<T>
|
|
>List : List<T>
|
|
>U : U
|
|
|
|
name: string;
|
|
>name : string
|
|
}
|
|
|
|
var o1: OwnerList<number>;
|
|
>o1 : OwnerList<number>
|
|
>OwnerList : OwnerList<U>
|
|
|
|
var o2: OwnerList2<number>;
|
|
>o2 : OwnerList2<number>
|
|
>OwnerList2 : OwnerList2<U>
|
|
|
|
o1 = o2; // should not error
|
|
>o1 = o2 : OwnerList2<number>
|
|
>o1 : OwnerList<number>
|
|
>o2 : OwnerList2<number>
|
|
|