* Get constraint with this argument of the type parameter for comparisons * Also instantiate indexed accesses * Add much simpler test
17 lines
389 B
TypeScript
17 lines
389 B
TypeScript
/* taken from mongoose.Document */
|
|
interface Document {
|
|
increment(): this;
|
|
}
|
|
|
|
/* our custom model extends the mongoose document */
|
|
interface CustomDocument extends Document { }
|
|
|
|
export class Example<Z extends CustomDocument> {
|
|
constructor() {
|
|
// types of increment not compatible??
|
|
this.test<Z>();
|
|
}
|
|
|
|
public test<Z extends Document>() { }
|
|
}
|