Skip to content

Suggestion: abstract classes #6

Description

Support an abstract keyword for classes and their methods

Examples:

abstractclassBase{abstractgetThing(): string;getOtherThing(){return'hello';}}varx=newBase();// Error, 'Base' is abstract// Error, must either be 'abstract' or implement concrete 'getThing'classDerived1extendsBase{}classDerived2extendsBase{getThing(){return'hello';}foo(){super.getThing();}// Error: cannot invoke abstract members through 'super'}varx=newDerived2();// OKvary: Base=newDerived2();// Also OKy.getThing();// OKy.getOtherThing();// OKabstractclassEmpty{}// OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommittedThe team has roadmapped this issueFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions