Fix missing return statements on function literals#31825
Fix missing return statements on function literals#31825jonahwilliams merged 3 commits intoflutter:masterfrom
Conversation
|
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(); |
There was a problem hiding this comment.
Let me investigate what this code is supposed to do ...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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;
It's the best time of the year! |
goderbauer
left a comment
There was a problem hiding this comment.
This LGTM once @jonahwilliams is happy.
Thanks, @srawlins!
|
Er, I hope the windows |
|
I would pull upstream and re push |
|
Yay all passed, someone merge for me? 😄 |
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.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?