2014-08-15 23:33:16 +02:00
|
|
|
=== 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>
|
2014-08-19 04:56:03 +02:00
|
|
|
>Cat : Cat<CatType>
|
2014-08-15 23:33:16 +02:00
|
|
|
>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>; }
|
2014-08-22 03:39:46 +02:00
|
|
|
>{ barry: cat} : { barry: Cat<IKitty>; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
barry: cat
|
|
|
|
>barry : Cat<IKitty>
|
2014-08-25 19:36:12 +02:00
|
|
|
>cat : Cat<IKitty>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
var catBag = new CatBag(catThing);
|
|
|
|
>catBag : CatBag
|
|
|
|
>new CatBag(catThing) : CatBag
|
|
|
|
>CatBag : typeof CatBag
|
|
|
|
>catThing : { barry: Cat<IKitty>; }
|
|
|
|
|