Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Conversation

@kevmoo
Copy link
Member

@kevmoo kevmoo commented Jul 20, 2017

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!

}

VoidFunc1<E> eventHandler0<E>(VoidFunc0 handler) {
void Function(E) eventHandler0<E>(void Function() handler) {
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

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)) {};

Copy link
Contributor

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.

Copy link
Member Author

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

@leonsenft
Copy link
Contributor

LTGM, although some of the files still contain function typdefs. It won't let me comment on them directly but see *_control_acccesors.dart for void registerOnChange(ChangeFunction fn).

@kevmoo
Copy link
Member Author

kevmoo commented Jul 20, 2017

LTGM, although some of the files still contain function typdefs. It won't let me comment on them directly but see *_control_acccesors.dart for void registerOnChange(ChangeFunction fn).

Yeah, those are used across many files – left them for now until we decide what to do.

@kevmoo kevmoo force-pushed the use_1_24_function branch from 10e92d0 to 0001832 Compare July 28, 2017 00:22
@kevmoo kevmoo changed the title Use 1.24 Function syntax WIP: Use 1.24 Function syntax Jul 28, 2017
@kevmoo kevmoo force-pushed the use_1_24_function branch from de692d3 to d371413 Compare July 28, 2017 19:04
@kevmoo kevmoo closed this Jul 28, 2017
@kevmoo kevmoo deleted the use_1_24_function branch July 28, 2017 21:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants