-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
There appears to be no way to extend a generic type using in a mixin-style pattern, because the type arguments cannot be passed through.
TypeScript Version: 2.7.1
Search Terms: base constructor, type arguments
Code
function subclass<T>(klasstype : T) : T {
// This is our mixin, but for demo purposes just return the class
return klasstype;
}
class DerivedPromise<T> extends subclass(Promise) { }
Expected behavior:
A class that extends Promise.
Actual behavior:
TS2508: No base constructor has the specified number of type arguments.
Playground Link:
Here
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code