Skip to content

Make non-top level declarations of typedef valid #2951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
purplenoodlesoop opened this issue Mar 27, 2023 · 3 comments
Closed

Make non-top level declarations of typedef valid #2951

purplenoodlesoop opened this issue Mar 27, 2023 · 3 comments
Labels
feature Proposed language feature that solves one or more problems

Comments

@purplenoodlesoop
Copy link

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);
  ...
}
@purplenoodlesoop purplenoodlesoop added the feature Proposed language feature that solves one or more problems label Mar 27, 2023
@lrhn
Copy link
Member

lrhn commented Mar 27, 2023

Existing issue in the SDK repo, which has not been moved to the language repo yet: #2952

@purplenoodlesoop
Copy link
Author

Thanks! Closing the issue then – searched in the language repo initially :)

@lrhn
Copy link
Member

lrhn commented Mar 29, 2023

Seems that another issue, #67, is also in the language repo, with a name that made it unsearchable. My bad 😁.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems
Projects
None yet
Development

No branches or pull requests

2 participants