Open
Description
TypeScript Version: 2.7
Search Terms: abstract class implements interface
Code
interface FooFace {
foo();
}
abstract class FooClass implements FooFace {
// ^^^^^^^^
// Class 'FooClass' incorrectly implements interface 'FooFace'.
// Property 'foo' is missing in type 'FooClass'.
//
// unless the following is uncommented:
//abstract foo();
}
// contrast:
abstract class BarClass {
abstract bar();
}
abstract class BarSubClass extends BarClass {
// no `abstract bar();` required
}
Expected behavior:
Abstract classes that implement interfaces don't need to define abstract type definitions to satisfy interface.
Actual behavior:
They do.
Related Issues:
- Implement interface helper does not consider what is already implemented on base classes #19847, where typescript fails to see that a superclass does implement a method (contrast this ticket, where typescript fails to see that a class need not implement a method)