Take a look at this example:
class A {
method(): void {}
}
class B extends A {
method(a: number, b: string): void {}
}
An error occurs when trying to implement method()
in class B.
My goal is to achieve the following functionality:
var b: B;
b.method(0, ''); // method overloaded by B
b.method(); // method inherited from A
Can this be accomplished with Typescript?
UPDATE: I have corrected the code - previously used function properties instead of methods.