Skip to content

Use non-nullable parameters for operator == #3446

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

Closed
wants to merge 1 commit into from

Conversation

natebosch
Copy link
Member

The null value will never be passed to the equals operator
implementation. Widening the type causes any other class which
implements this interface to also widen the type.

The null value will never be passed to the equals operator
implementation. Widening the type causes any other class which
implements this interface to also widen the type.
@natebosch natebosch requested a review from jonasfj June 2, 2022 23:53
@sigurdm
Copy link
Contributor

sigurdm commented Jun 3, 2022

This is vendored code - the fix should probably land in package:tar first.

cc @simolus3

@simolus3
Copy link
Contributor

simolus3 commented Jun 3, 2022

Widening the type causes any other class which implements this interface to also widen the type.

To be fair, TarFormat is @sealed and SparseEntry is not exported.

Thanks for the pointers though, I'll fix this in packag:tar and open another PR for a roll into pub.

@sigurdm
Copy link
Contributor

sigurdm commented Jun 3, 2022

Thanks for the pointers though, I'll fix this in packag:tar and open another PR for a roll into pub.

If you want you can be dog-fooding jonas's new vendor-package: https://pub.dev/packages/vendor for importing the tar package!

@simolus3 simolus3 mentioned this pull request Jun 3, 2022
@simolus3
Copy link
Contributor

simolus3 commented Jun 3, 2022

I've opened dart-lang/sdk#58757 which includes these changes.

If you want you can be dog-fooding jonas's new vendor-package: https://pub.dev/packages/vendor for importing the tar package!

I've tried it, but it keeps the lib folder in the path whereas we just put contents of lib directly into third_party/tar (google/dart-neats#183). That second lib/ in the path triggers some lints, so it's probably easier to keep the directory structure as it is now.

@natebosch
Copy link
Member Author

To be fair, TarFormat is @sealed and SparseEntry is not exported.

Yeah, the impact is pretty limited. I wanted to clean up what I found though, because I'd like to push for this to be added as a lint.

dart-lang/sdk#58753

@natebosch
Copy link
Member Author

and open another PR for a roll into pub.

Thanks!

Superseded by #3447

@natebosch natebosch closed this Jun 3, 2022
@natebosch natebosch deleted the non-nullable-equals-parameter branch June 3, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants