Skip to content

Conversation

@swift-kim
Copy link
Contributor

The abstract class Pub and its implementations (_DefaultPub, ThrowingPub, and etc.) have slightly different method signatures. For example, _DefaultPub.batch allows null directory paths while Pub.batch doesn't (this is grammatically correct because Pub is an abstract class):

Future<void> batch(
List<String> arguments, {
required PubContext context,
String directory,
MessageFilter filter,
String failureMessage = 'pub failed',
required bool retry,
bool showTraceForErrors,
});

Future<void> batch(
List<String> arguments, {
required PubContext context,
String? directory,
MessageFilter? filter,
String failureMessage = 'pub failed',
required bool retry,
bool? showTraceForErrors,
String? flutterRootOverride,
}) async {

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

@flutter-dashboard
Copy link

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.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 9, 2022
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@jmagman
Copy link
Member

jmagman commented Feb 9, 2022

Adding second reviewer @christopherfujino

@christopherfujino
Copy link
Contributor

I'm surprised an implementing class can override a method with a more loose (i.e. nullable) argument type. In any case, nice catch.

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot fluttergithubbot merged commit 2a010d9 into flutter:master Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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