-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
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
GoToLoop, atrauzzi, trusktr, alexanderbird, rjamesnw and 19 more
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript