Skip to content

Missing property declaration in abstract class implementing interfaces #4670

Closed
@denvned

Description

@denvned

Abstract class should not be required to implement all the properties/methods of the interfaces it implements. So the following should be legal:

interface A {
  p;
  m();
}

abstract class B implements A {
}

class C extends B {
  get p() {...};
  set p(v) {...};
  m() {...}
}

But currently it gives:

Error:(2, 16) TS2420: Class 'B' incorrectly implements interface 'A'. Property 'p' is missing in type 'B'.

This issue is related to proposal #3578.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions