Skip to content

Make non-top level declarations of typedef valid #2951

Closed
@purplenoodlesoop

Description

@purplenoodlesoop

Currently, it is not possible to create a typedef not as a top-level entity. However, they could be useful as a class member (static or not), or in a function body.

It is open to discussing how they should behave in classes, but it looks like it should be entirely possible to do the following:

void foo<T extends Object?>() {
  typedef Double = T Function(T value);
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProposed language feature that solves one or more problems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions