-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[flutter_tools] Make variants of Pub have consistent method signatures #98119
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
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
jmagman
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, thanks!
|
Adding second reviewer @christopherfujino |
|
I'm surprised an implementing class can override a method with a more loose (i.e. nullable) argument type. In any case, nice catch. |
christopherfujino
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
The abstract class
Puband its implementations (_DefaultPub,ThrowingPub, and etc.) have slightly different method signatures. For example,_DefaultPub.batchallows null directory paths whilePub.batchdoesn't (this is grammatically correct becausePubis an abstract class):flutter/packages/flutter_tools/lib/src/dart/pub.dart
Lines 122 to 130 in c54a27d
flutter/packages/flutter_tools/lib/src/dart/pub.dart
Lines 300 to 309 in c54a27d
This discrepancy has been caused by manual null safety migration in #80548 and seems to be a simple human error.
This change doesn't fix any existing error, and also doesn't change the tool's behavior, so there should be no need for tests.
cc @jmagman