mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 19:21:33 +03:00
24 lines
510 B
TypeScript
24 lines
510 B
TypeScript
// instantiating a derived type can cause an infinitely expanding type reference to be generated
|
|
|
|
interface List<T> {
|
|
data: T;
|
|
next: List<T>;
|
|
owner: OwnerList<T>;
|
|
}
|
|
|
|
// will have an owner property that is an infinitely expanding type reference
|
|
interface OwnerList<U> extends List<List<U>> {
|
|
name: string;
|
|
}
|
|
|
|
var list: List<string>;
|
|
var ownerList: OwnerList<string>;
|
|
list = ownerList;
|
|
|
|
function other<T>(x: T) {
|
|
var list: List<T>;
|
|
var ownerList: OwnerList<T>;
|
|
list = ownerList;
|
|
|
|
}
|