-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add typedef void VoidCallback(); to dart:core #27791
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
Comments
The func package already contains some predefined typedef. VoidFunc0 in this case. |
I guess I'm a weird duck in that I'm writing code that can't depend on packages. |
The func package is marked as 'discontinued', does that affect the decision here? |
I'm guessing the reason the func package is discontinued is that the language has added syntax for expressing function types directly. You can now write We don't plan to add function type aliases for simple types like this, we recommend just usig the function type syntax. |
:-(
|
I tend to disagree about the readability. Reading |
Mostly it's less readable just because function signature literals are hard to read in general (they have multiple keywords, parentheses, etc) vs a single word. I agree that |
Would it be possible to add the follow declaration to
dart:core
I keep needing this typedef and it seems ugly to redeclare it in every package.
Thanks!
/cc @floitschG
The text was updated successfully, but these errors were encountered: