I want to overload an abstract method within an abstract class like this:
abstract class Animal {
public abstract communicate(sentence: string): void;
public abstract communicate(notes: string[]): void;
}
class Human extends Animal {
public communicate(sentence: string): void {
// Do stuff
}
}
class Bird extends Animal {
public communicate(notes: string[]): void {
// Do stuff
}
}
However, Typescript gives an error, stating I incorrectly extend the base class (Animal)
Is there something I am doing wrong? Like expecting something to work which would work anyway according to OOP? Or is it something Typescript doesn't support?
Note: The type of the parameter can be entirely different types unlike in this example.