TS2515: Abstract Member Not Implemented: What It Means and How to Fix It
Error reference
TS2515: Abstract Member Not Implemented
Language
Severity
MediumWhen it happens
TypeScript error TS2515 is reported when a concrete (non-abstract) class extends an abstract class but does not implement all of its abstract members.
Potential fixes
Implement all abstract methods in your concrete class. Your IDE will usually show which methods are missing. When adding a new abstract method to a base class, TypeScript will immediately flag all subclasses that need updating.
Deep dive
TypeScript error TS2515 is reported when a concrete (non-abstract) class extends an abstract class but does not implement all of its abstract members. Abstract members define the interface that subclasses must fulfill.
Why it happens
- •A subclass is missing an implementation of one or more abstract methods.
- •A method was added to the abstract class but not yet added to all subclasses.
- •Copy-pasting a class definition without updating the abstract implementations.
- •Renaming an abstract method without updating the subclass override.
Potential fixes
Implement all abstract methods in your concrete class. Your IDE will usually show which methods are missing. When adding a new abstract method to a base class, TypeScript will immediately flag all subclasses that need updating.
Examples
Code that triggers the error
abstract class Shape {
abstract area(): number;
}
class Circle extends Shape {
// forgot to implement area()
}Error output
error TS2515: Non-abstract class 'Circle' does not implement inherited abstract member 'area' from class 'Shape'.
Fixed code
abstract class Shape {
abstract area(): number;
}
class Circle extends Shape {
constructor(private radius: number) {
super();
}
area(): number {
return Math.PI * this.radius ** 2;
}
}Practice in English
How would you explain a TS2515: Abstract Member Not Implemented to a fellow dev? Choose the right phrase:
"I hit an error...
Ready to practice your English at work?
Lingua-e has interactive exercises built around real developer conversations: standups, code reviews, retrospectives, and more. Practice until it comes naturally.
Try Lingua-e for free