What do I need to fix in order for this code to function properly?
abstract class Animal {
// No constructor
...
public abstract me():Animal;
}
class Cat extends Animal {
constructor() {
super();
}
// Why does this not work as expected? Shouldn't every cat be considered an Animal?
me():Cat {
return this;
}
}
An error is encountered:
Type 'this' is not assignable to type 'Animal'.