49 lines
909 B
Plaintext
49 lines
909 B
Plaintext
=== tests/cases/compiler/prespecializedGenericMembers1.ts ===
|
|
export interface IKitty {
|
|
>IKitty : IKitty
|
|
|
|
}
|
|
|
|
export class Cat<CatType extends IKitty> {
|
|
>Cat : Cat<CatType>
|
|
>CatType : CatType
|
|
>IKitty : IKitty
|
|
|
|
constructor() {
|
|
|
|
}
|
|
}
|
|
|
|
export class CatBag {
|
|
>CatBag : CatBag
|
|
|
|
constructor(cats: { barry: Cat<IKitty>; }) {
|
|
>cats : { barry: Cat<IKitty>; }
|
|
>barry : Cat<IKitty>
|
|
>Cat : Cat<CatType>
|
|
>IKitty : IKitty
|
|
|
|
}
|
|
}
|
|
var cat = new Cat<IKitty>();
|
|
>cat : Cat<IKitty>
|
|
>new Cat<IKitty>() : Cat<IKitty>
|
|
>Cat : typeof Cat
|
|
>IKitty : IKitty
|
|
|
|
var catThing = {
|
|
>catThing : { barry: Cat<IKitty>; }
|
|
>{ barry: cat} : { barry: Cat<IKitty>; }
|
|
|
|
barry: cat
|
|
>barry : Cat<IKitty>
|
|
>cat : Cat<IKitty>
|
|
|
|
};
|
|
var catBag = new CatBag(catThing);
|
|
>catBag : CatBag
|
|
>new CatBag(catThing) : CatBag
|
|
>CatBag : typeof CatBag
|
|
>catThing : { barry: Cat<IKitty>; }
|
|
|