Skip to content

Conversation

@srawlins
Copy link
Contributor

@srawlins srawlins commented Apr 30, 2019

Description

This PR fixes missing return statements that will be enforced in an upcoming build of Dart, when https://dart-review.googlesource.com/c/sdk/+/100301 lands.

Tests

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@srawlins
Copy link
Contributor Author

Merry Christmas, @goderbauer

final ServiceEvent pauseEvent = view.uiIsolate.pauseEvent;
if ((pauseEvent != null) && pauseEvent.isPauseEvent) {
// Resume the isolate so that it can be killed by the embedder.
return view.uiIsolate.resume();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me investigate what this code is supposed to do ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this one's super weird. AFAICT, there is no reason then(THIS) should have to return something. I think the error,

This function has a return type of 'Future<Map<String, dynamic>>', but doesn't
end with a return statement • packages/flutter_tools/lib/src/run_hot.dart:443:13

is saying that one path returns a Future<Map<String, dynamic>>, and another pass doesn't return anything, and those two paths then don't match any consistent return type. This return value isn't used anywhere, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whenComplete triggers off of the returned future, or the immediate result of return null. in this case it should be:

if ((pauseEvent != null) && pauseEvent.isPauseEvent) {
  return view.uiIsolate.resume();
}
return null;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@goderbauer
Copy link
Member

Merry Christmas, @goderbauer

It's the best time of the year!

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM once @jonahwilliams is happy.

Thanks, @srawlins!

@goderbauer goderbauer added framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. and removed framework flutter/packages/flutter repository. See also f: labels. labels Apr 30, 2019
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@srawlins
Copy link
Contributor Author

srawlins commented May 7, 2019

Er, I hope the windows syntax_error_test.broken_dart failures are unrelated?

@jonahwilliams
Copy link
Contributor

I would pull upstream and re push

@srawlins
Copy link
Contributor Author

srawlins commented May 9, 2019

Yay all passed, someone merge for me? 😄

@jonahwilliams jonahwilliams merged commit 9c77e8e into flutter:master May 9, 2019
@srawlins srawlins mentioned this pull request May 10, 2019
9 tasks
@srawlins srawlins mentioned this pull request May 20, 2019
9 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants