-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix missing return statements on function literals #31825
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong
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.
Let me investigate what this code is supposed to do ...
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 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.
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;
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.
Done!
It's the best time of the year! |
goderbauer
left a comment
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.
This LGTM once @jonahwilliams is happy.
Thanks, @srawlins!
jonahwilliams
left a comment
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.
LGTM
|
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?