-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
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-false-negativeIssues related to lint rules that fail to report a problem.Issues related to lint rules that fail to report a problem.linter-set-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Describe the issue
According to #58427, collection_methods_unrelated_type should warn about using null as a key to a non-nullable collection. However, the following code does not generate the lint:
final v = <String, String>{ “somekey” : “somevalue” };
final nv = v[null];If this is expected, I propose another lint that will warn about indexing into collections with non-null keys with potentially null values.
To Reproduce
The following code:
final v = <String, String>{ “somekey” : “somevalue” };
final nv = v[null];Expected behavior
Warn on line 2 about null being used to on a map with non-null keys.
julemand101 and srawlins
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-false-negativeIssues related to lint rules that fail to report a problem.Issues related to lint rules that fail to report a problem.linter-set-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug