40 lines
696 B
TypeScript
40 lines
696 B
TypeScript
//// [prespecializedGenericMembers1.ts]
|
|
export interface IKitty {
|
|
|
|
}
|
|
|
|
export class Cat<CatType extends IKitty> {
|
|
constructor() {
|
|
|
|
}
|
|
}
|
|
|
|
export class CatBag {
|
|
constructor(cats: { barry: Cat<IKitty>; }) {
|
|
|
|
}
|
|
}
|
|
var cat = new Cat<IKitty>();
|
|
var catThing = {
|
|
barry: cat
|
|
};
|
|
var catBag = new CatBag(catThing);
|
|
|
|
//// [prespecializedGenericMembers1.js]
|
|
var Cat = (function () {
|
|
function Cat() {
|
|
}
|
|
return Cat;
|
|
})();
|
|
exports.Cat = Cat;
|
|
var CatBag = (function () {
|
|
function CatBag(cats) {
|
|
}
|
|
return CatBag;
|
|
})();
|
|
exports.CatBag = CatBag;
|
|
var cat = new Cat();
|
|
var catThing = {
|
|
barry: cat
|
|
};
|
|
var catBag = new CatBag(catThing);
|