TS2420
error TS2420: Class ‘Dog’ incorrectly implements interface ‘Animal’. Property ‘name’ is private in type ‘Dog’ but not in type ‘Animal’.
Broken Code ❌
1 |
|
Fixed Code ✔️
The Animal
interface defines a public name
member. The name
property in our Dog
class must therefore also be public:
1 |
|