-
Notifications
You must be signed in to change notification settings - Fork 231
WIP: Use 1.24 Function syntax #550
Conversation
| } | ||
|
|
||
| VoidFunc1<E> eventHandler0<E>(VoidFunc0 handler) { | ||
| void Function(E) eventHandler0<E>(void Function() handler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we decided on what syntax to use when declaring function parameters? Both are valid:
void Function(E) eventHandler0<E>(void Function() handler) {}
void Function(E) eventHandler0<E>(void handler()) {}I'm in favor of the latter as it's more concise, but I can understand the desire to be consistent with the former.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we decided always the former, the latter may be removed in a future version of Dart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And encouraging the new syntax is goodness.
// No error, but this handle has no argument type
foo(void handler(int)) {};
// Does what you expect
foo(void Function(int)) {};There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case there are some old style function parameters in these files you could update as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah...but that's hard to regexp
I'd almost want a lint for that
|
LTGM, although some of the files still contain function typdefs. It won't let me comment on them directly but see |
Yeah, those are used across many files – left them for now until we decide what to do. |
Remove pkg/func dependency
10e92d0 to
0001832
Compare
de692d3 to
d371413
Compare
Blocked on a new analyzer release - dart-lang/sdk#30239
Using alpha pkg/analyzer to see if travis gets happy
Looks like we need to update to use the 1.25.0-dev SDK, too!