- Error
- Reported by the type checker
TS2515
Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'.
A concrete class extends an abstract class but doesn't implement one of its abstract members. Implement the member, or make the class abstract too.
What it means
Every abstract member of a base class must be implemented by the first non-abstract class that extends it. The class name is reported with the missing member and the class that declares it.
Example
abstract class Shape {
abstract area(): number;
}
export class Circle extends Shape {}
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(4,14): error TS2515: Non-abstract class 'Circle' does not implement inherited abstract member area from class 'Shape'.
Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.
How to fix
- Implement the member in the class (here an
area()method). - Or mark the class
abstractand implement it in a further subclass.