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

Found 23 files excluded from sound null safety #3442

Closed
Tracked by #49169
devoncarew opened this issue Jun 3, 2022 · 2 comments
Closed
Tracked by #49169

Found 23 files excluded from sound null safety #3442

devoncarew opened this issue Jun 3, 2022 · 2 comments

Comments

@devoncarew
Copy link
Member

Found 23 files excluded from sound null safety:

test/rules/null_closures_test.dart:23:// @dart=2.9
test/rules/null_closures_test.dart:31:// @dart=2.9
test/rules/null_closures_test.dart:41:// @dart=2.9
test/rules/null_closures_test.dart:51:// @dart=2.9
test/rules/prefer_collection_literals_test.dart:23:// @dart=2.9    
test/rules/prefer_collection_literals_test.dart:32:// @dart=2.9    
test/rules/prefer_collection_literals_test.dart:41:// @dart=2.9    
test_data/integration/always_require_non_null_named_parameters/lib.dart:5:// @dart=2.9
test_data/integration/avoid_private_typedef_functions/lib.dart:5:// @dart=2.9
test_data/integration/avoid_private_typedef_functions/part.dart:5:// @dart=2.9
test_data/integration/cancel_subscriptions/cancel_subscriptions.dart:5:// @dart=2.9
test_data/integration/close_sinks/src/a.dart:5:// @dart=2.9
test_data/integration/only_throw_errors/only_throw_errors.dart:5:// @dart=2.9
test_data/integration/overridden_fields/src/a.dart:5:// @dart=2.9
test_data/integration/overridden_fields/src/b.dart:5:// @dart=2.9
test_data/integration/public_member_api_docs/test/b.dart:5:// @dart=2.9
test_data/integration/use_build_context_synchronously/lib/unmigrated.dart:5:// @dart=2.9
test_data/rules/always_require_non_null_named_parameters.dart:7:// @dart=2.9
test_data/rules/avoid_init_to_null.dart:5:// @dart=2.9
test_data/rules/avoid_returning_null.dart:7:// @dart=2.9
test_data/rules/avoid_returning_null_for_future.dart:7:// @dart=2.8
test_data/rules/prefer_bool_in_asserts.dart:5:// @dart=2.9
test_data/rules/void_checks.dart:7:// @dart=2.9

See dart-lang/sdk#49169 for more context.

@devoncarew
Copy link
Member Author

Some of the above look like exclusions test nnbd opt-outs, but others looks like excluded tests (which should be converted over to null safe).

@pq
Copy link
Member

pq commented Jun 4, 2022

Thanks for this!

others looks like excluded tests

From a quick look, these all appear to be exclusions in test data. The ones in the test/ directory are in strings, for example:

  test_list_firstWhere() async {
    await assertNoDiagnostics(r'''
// @dart=2.9
f() => <int>[2, 4, 6].firstWhere((e) => e.isEven, orElse: () => null);
''');
  }

in https://github.com/dart-lang/linter/blob/master/test/rules/null_closures_test.dart#L23

is defined in pre-nnnbd NullClosuresPreNNBDTest.

Given how many folks internally haven't migrated I think there's value in continuing to test these cases.

I'll go ahead and close this as per dart-lang/sdk#49169 but feel free to re-open if you want to discuss some more.

Again, thanks!

@pq pq closed this as completed Jun 4, 2022
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

No branches or pull requests

2 participants