TS2720

Class 'Dog' incorrectly implements class 'Animal'. Did you mean to extend 'Animal' and inherit its members as a subclass? Property 'makeNoise' is protected but type 'Dog' is not a class derived from 'Animal'.

Broken Code ❌

abstract class Animal {
  protected abstract makeNoise(): string;
}
 
class Dog implements Animal {
  protected makeNoise(): string {
    return 'Woof!';
  }
}

Fixed Code ✔️

The implements keyword is reserved to implement interfaces. If you want to work with class inheritance, you have to use extends:

abstract class Animal {
  protected abstract makeNoise(): string;
}
 
class Dog extends Animal {
  protected makeNoise(): string {
    return 'Woof!';
  }
}

Video Tutorial