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.
Describe the issue
According to #58427,
collection_methods_unrelated_typeshould warn about usingnullas a key to a non-nullable collection. However, the following code does not generate the lint: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:
Expected behavior
Warn on line 2 about
nullbeing used to on a map with non-null keys.