Skip to content

Proposal: new syntax for defining abstract methods #6833

Closed
@fphh

Description

@fphh

Currently, we write


abstract class A {
  abstract f() : void;
} 

Wouldn't it be nicer to write:


abstract class A {
  abstract f : () => void;
}

That would syntactically go smoothly with type aliases:


type t = () => void;
abstract class A {
  abstract f : t;
}

which currently (1.7.5) is disallowed. (See #6832).

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions