-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Closed
Copy link
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
This request is motivated by a breakage I found in google3, and the potential for many more as null safety migrations continue.
Would it be possible to create a lint to trigger when:
- An API is defined in a null safe library.
- The API is implemented in a null safe library.
- The API definition and implementation are only related through a library that is not yet null safe.
In this example a method signature is defined in a null safe mixin and returns int. The implementation is in a null safe library and returns int?. There is no direct relation between the definition and the implementation so there are no errors. They are brought together by another class that has not yet been migrated to null safety, so still no errors even though we know that the implementation is invalid for the method signature defined by the mixin.
file1.dart (not migrated to null safety)
class C extends B with M {}file2.dart (migrated to null safety)
class B {
int? fn() => null;
}file3.dart (migrated to null safety)
mixin M {
int fn();
}Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug