Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Don't report avoid_function_literals_in_foreach_calls with null-aware call #4039

Merged
merged 4 commits into from
Feb 27, 2023

Conversation

oprypin
Copy link
Contributor

@oprypin oprypin commented Feb 1, 2023

The current behavior is fully correct in null-safe mode, but in legacy mode the check for nullable type is inverted.

Not adding a test because there is no legacy-mode test file.

Closes dart-lang/sdk#58710

…re call

The current behavior is fully correct in null-safe mode, but in legacy mode the check for nullable type is inverted.

Not adding a test because there is no legacy-mode test file.

Closes #3354
@github-actions github-actions bot added the linter-set-recommended Affects a rule in the recommended Dart rule set label Feb 1, 2023
@coveralls
Copy link

coveralls commented Feb 1, 2023

Coverage Status

Coverage: 95.664%. Remained the same when pulling 392353c on foreach_calls_null_aware into b96f861 on main.

@bwilkerson
Copy link
Contributor

Not adding a test because there is no legacy-mode test file.

The preferred method for testing, going forward, is to write a test class in test/rules and use the reflective test loader. It's better for several reasons, but one of them is that it makes it easy to write tests against different language versions.

@oprypin
Copy link
Contributor Author

oprypin commented Feb 1, 2023

Thanks. In any case, I am not taking up the task to add a completely new test focused on legacy mode. So if this is a blocker for this PR, it will remain unresolved.

@oprypin oprypin closed this Feb 3, 2023
@oprypin oprypin reopened this Feb 17, 2023
@oprypin
Copy link
Contributor Author

oprypin commented Feb 17, 2023

PTAL

@oprypin oprypin requested a review from pq February 25, 2023 09:42
Copy link
Contributor

@pq pq left a comment

Choose a reason for hiding this comment

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

Thanks!

@pq pq merged commit f84fb4e into main Feb 27, 2023
@pq pq deleted the foreach_calls_null_aware branch February 27, 2023 17:44
oprypin added a commit that referenced this pull request May 6, 2023
Fixes #4328. Reverts #4039 that caused false negatives in non-null-safe mode. And reverts #2752 along with it because it was not the exact right fix in the first place. Null-aware calls are since handled by #4305 and all the existing tests still pass.
oprypin added a commit that referenced this pull request May 6, 2023
Fixes #4328. Reverts #4039 that caused false negatives in non-null-safe mode. And reverts #2752 along with it because it was not the exact right fix in the first place. Null-aware calls are since handled by #4305 and all the existing tests still pass.
oprypin added a commit that referenced this pull request May 6, 2023
Fixes #4328. Reverts #4039 that caused false negatives in non-null-safe mode. And reverts #2752 along with it because it was not the exact right fix in the first place. Null-aware calls are since handled by #4305 and all the existing tests still pass.
pq pushed a commit that referenced this pull request May 8, 2023
…#4330)

Fixes #4328. Reverts #4039 that caused false negatives in non-null-safe mode. And reverts #2752 along with it because it was not the exact right fix in the first place. Null-aware calls are since handled by #4305 and all the existing tests still pass.
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 23, 2023
…re call (dart-archive/linter#4039)

* Don't report `avoid_function_literals_in_foreach_calls` with null-aware call

The current behavior is fully correct in null-safe mode, but in legacy mode the check for nullable type is inverted.

Not adding a test because there is no legacy-mode test file.

Closes dart-lang/linter#3354

* Add test

* Move test to noSoundNullSafety
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 23, 2023
…dart-archive/linter#4330)

Fixes dart-lang/linter#4328. Reverts dart-archive/linter#4039 that caused false negatives in non-null-safe mode. And reverts dart-archive/linter#2752 along with it because it was not the exact right fix in the first place. Null-aware calls are since handled by dart-archive/linter#4305 and all the existing tests still pass.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter-set-recommended Affects a rule in the recommended Dart rule set
Development

Successfully merging this pull request may close these issues.

avoid_function_literals_in_foreach_calls is unfriendly to ?.
4 participants