Skip to content

Conversation

stuartmorgan-g
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g commented Jan 31, 2023

In #3095 I accidentally changed a constructor argument's nullability because I wasn't familiar with the correct variation of super parameters, and addressed a lint warning incorrectly. That version has been retracted; this restores the original behavior.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

In flutter#3095 I accidentally changed
a constructor argument's nullability because of a misleading analyzer
warning. That version has been retracted; this restores the original
behavior.
@stuartmorgan-g
Copy link
Collaborator Author

The test is convoluted, but it works (and is arguably no more convoluted than the three-files-that-must-match structure of the class itself).

@stuartmorgan-g
Copy link
Collaborator Author

Filed dart-lang/sdk#51196 for the false positive.

Although it's not actually clear to me why XFileBase has a constructor at all. Do you know what the reason was?

@asashour
Copy link
Contributor

asashour commented Feb 1, 2023

A humble suggestion, the code could be written as:

  XFile(
    String super.path, {
    String? mimeType,
    ...
  }) {

@stuartmorgan-g
Copy link
Collaborator Author

A humble suggestion, the code could be written as

Indeed; fixed, and updated the PR description to reflect that the analyzer wasn't at all the problem. Thanks!

Copy link
Member

@ditman ditman 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 for the test!!

@ditman
Copy link
Member

ditman commented Feb 1, 2023

it's not actually clear to me why XFileBase has a constructor at all. Do you know what the reason was?

@stuartmorgan I don't remember, my only suspicion is to attempt to mandate that all subclasses (at least) have a path parameter? Not sure that's a valid solution (or requirement!)

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 1, 2023
@auto-submit auto-submit bot merged commit ff89d92 into flutter:main Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: cross_file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants