TS2515: Non-abstract class does not implement abstract member - in CI
A concrete class extends an abstract class but does not implement one of its abstract members.
What this error means
Type-checking fails with TS2515 naming the abstract member the subclass left unimplemented.
tsc
src/shape.ts(10,7): error TS2515: Non-abstract class 'Circle' does not implement inherited abstract member 'area' from class 'Shape'.Common causes
How to fix it
Implement the abstract member
- Add the method/property with a matching signature in the subclass
ts
class Circle extends Shape {
area(): number { return Math.PI * this.r ** 2 }
}Keep the subclass abstract if intended
- If the class is not meant to be instantiated, declare it abstract too
How to prevent it
- Implement all abstract members when subclassing, or keep intermediate classes abstract.
Related guides
TS2564: Property has no initializer - in CIFix "error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor" under s…
TS2322: Type is not assignable - in CIFix "error TS2322: Type 'X' is not assignable to type 'Y'" when tsc runs in CI - a genuine type mismatch on a…