Closed
Description
TypeScript Version: 2.8.0-dev.20180308
Code
interface Instance {
foo: number;
}
interface Constructor<I extends Instance> {
new(): I;
}
function MixIn<T extends Instance>(Base: Constructor<T>) {
return class extends Base {
}
}
Expected behavior:
That my MixIn accepts that construct so that I can define a extended interface T with properties which are available at a instance of the MixIn class.
Actual behavior:
error TS2509: Base constructor return type 'T' is not a class or interface type.
It works when I remove the generic type at the function MixIn
(like function MixIn(Base: Constructor<Instance>)
) .
Related Issues:
I found old issues like #8853 or #4890
Because that I thought it should work.