Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@scheglov
Copy link
Contributor

@scheglov scheglov commented Nov 5, 2020

We want to enforce the migration order, and show when a legacy library is migrated into a Null Safe library.
See https://dart-review.googlesource.com/c/sdk/+/170441

There are several violations in Flutter.
I'd like to ignore them, and land the analyzer CL to prevent further regressions.

import 'package:test/bootstrap/browser.dart';
import 'package:test/test.dart';
import 'package:ui/ui.dart';
import 'package:test/bootstrap/browser.dart'; // ignore: import_of_legacy_library_into_null_safe
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Do we need to change every occurrence of this import? I think we use it many golden tests, example: https://github.com/flutter/engine/blob/master/lib/web_ui/test/golden_tests/engine/canvas_blend_golden_test.dart

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only if the library that imports it is Null Safe, i.e. the Dart SDK is 2.12.0, and the library does not opt-out from null safety. The example you pointed at does opt-out, it has // @dart = 2.6, so sets the language version to 2.6, which is less than 2.12 where non-nullable feature it released, and less than 2.10 when this feature was experimentally-released.

@scheglov
Copy link
Contributor Author

scheglov commented Nov 6, 2020

@nturgut Do you have concerns with these changes, something I should fix?

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

rslgtm

@scheglov scheglov merged commit cf37614 into flutter:master Nov 6, 2020
@scheglov scheglov deleted the ignore-several-importLegacyIntoNullSafe branch November 6, 2020 17:55
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 6, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 6, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2020
chaselatta pushed a commit to chaselatta/engine that referenced this pull request Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants