Skip to content
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

Deprecate whereNotNull from IterableNullableExtensions #332

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

oprypin
Copy link
Member

@oprypin oprypin commented Jan 25, 2024

Dart SDK since 3.0 has an exact equivalent extension nonNulls in the core.



  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Dart SDK since 3.0 has an exact equivalent extension `nonNulls` in the core.
@natebosch natebosch requested a review from lrhn January 25, 2024 23:00
@natebosch
Copy link
Member

cc @bwilkerson - would it be feasible to add support in dart_fix.yaml to replace a method with no arguments with a field? I don't think we currently have a way to automate the fix we need:

import 'package:collection/collection.dart';

void main() {
  [].whereNotNull().join('');
}

Should become

void main() {
  [].nonNulls.join('');
}

The transform I think I want, but is currently an error:

  - title: 'Replace whereNotNull() with core nonNulls'
    date: 2024-01-25
    element:
      uris: ['collection.dart']
      method: 'whereNotNull'
      inExtension: 'IterableExtension'
    changes:
      - kind: 'replacedBy'
        newElement:
          uris: ['dart:core']
          field: 'nonNulls'
          inClass: 'NullableIterableExtensions'

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.

rewrite whereNotNull without sync*
3 participants