Skip to content

Abstract methods #2947

Closed
Closed
@RyanCavanaugh

Description

@RyanCavanaugh

As a continuation of #6, which allows the abstract modifier on class declarations, we should extend this to class methods.

Relevant points:

  • An abstract method may only be declared in an abstract class
  • abstract methods may not have implementations
  • abstract methods may not be private, but may be protected
  • It is an error to invoke an abstract method via super in a derived clas
  • Fields may not be abstract
  • Property getters / setters may not be abstract
  • A class must be marked abstract if it does not overwrite all of its abstract base class's abstract methods
  • All overloads of a method must have, or not have, the abstract modifier
  • Static methods may not be abstract
  • abstract modifier must come after public or protected modifier

Secondary clarifications:

  • abstract has no impact on assignability / subtype / supertype relations

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommittedThe team has roadmapped this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions