mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
Fix for import directive in part while checking for IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE.
Bug: https://github.com/dart-lang/sdk/issues/44280 Change-Id: I6a8ef25deaedc55ef33e83ba7614f23fd56fe788 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174220 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
6905e30446
commit
fe3dd43995
2 changed files with 17 additions and 0 deletions
|
@ -929,6 +929,10 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
|
|||
}
|
||||
|
||||
var importElement = node.element;
|
||||
if (importElement == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var importedLibrary = importElement.importedLibrary;
|
||||
if (importedLibrary == null || importedLibrary.isNonNullableByDefault) {
|
||||
return;
|
||||
|
|
|
@ -63,6 +63,19 @@ class A {}
|
|||
import 'a.dart';
|
||||
|
||||
void f(A a) {}
|
||||
''');
|
||||
}
|
||||
|
||||
test_nullSafe_into_nullSafe_part() async {
|
||||
newFile('$testPackageLibPath/a.dart', content: '');
|
||||
|
||||
newFile('$testPackageLibPath/b.dart', content: r'''
|
||||
part of 'test.dart';
|
||||
import 'a.dart';
|
||||
''');
|
||||
|
||||
await assertNoErrorsInCode(r'''
|
||||
part 'b.dart';
|
||||
''');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue