TS2720
error 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 ❌
1 |
|
Fixed Code ✔️
The implements
keyword is reserved to implement interfaces. If you want to work with class inheritance, you have to use extends
:
1 |
|