Search Terms
abstract derived class constructor signature error message
Suggestion
Currently the following code:
abstract class A { }
class B extends A {
constructor(a: string) {
super();
}
}
const b: typeof A = B;
will give you the following error: Type 'typeof B' is not assignable to type 'typeof A'.
When you encountering this issue for the first time as a new typescript user, and you already have a bunch of code for both abstract and derived classes, it might be hard to track down what is causing the type error. So consider adding more specificity to the error message, smth like "Derived class should have the same constructor signature as a parent".
Use Cases
Currently error message is not clear enough.
Examples
Checklist
My suggestion meets these guidelines:
Search Terms
abstract derived class constructor signature error message
Suggestion
Currently the following code:
will give you the following error:
Type 'typeof B' is not assignable to type 'typeof A'.When you encountering this issue for the first time as a new typescript user, and you already have a bunch of code for both abstract and derived classes, it might be hard to track down what is causing the type error. So consider adding more specificity to the error message, smth like "Derived class should have the same constructor signature as a parent".
Use Cases
Currently error message is not clear enough.
Examples
Checklist
My suggestion meets these guidelines: