error TS2611: ‘
name‘ is defined as a property in class ‘
Person‘, but is overridden here in ‘
MyPerson‘ as an accessor.
Broken Code ❌
Getters and setters are property accessors, so you have to make sure that you don’t mix property definitions with property accessor definitions. Using the
accessor keyword, you can turn a property into a property accessor: