Closed
Description
There appears to be some kind of internal "class" type that is impossible to represent generically:
You can see a live version here: http://goo.gl/exBzY6
function IdentifiableSubclass<T extends What?>(SuperClass: T) {
return class extends T {
public _id = null;
}
}
class Thing {
public hello = null;
/* impl */
}
const IdentifiableThing = IdentifiableSubclass(Thing);
class ChildThing extends IdentifiableThing {
}
let child = new ChildThing();
child.hello; // TS does not understand that this exists
child._id; // TS understands that this exists