-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn on call to Map.remove with unrelated type #57434
Comments
Seems like this can just be folded into list_remove_unrelated_type? Can't imagine why someone would want to use one and not the other. |
But the name of the lint is completely unrelated to map. |
More importantly, extending a rule to produce lints where it never did before is, in some sense, a breaking change for anyone using the lint. |
I don't think that the name should prevent us from re-using it. We can create an alias for Is there a reason to not make a breaking change? Just bump the appropriate version number. |
Unfortunately linter package is not like any other package. It's bundled in the sdk with the analyzer. So a simple new release of the sdk may come with a new version of linter. Actually the version number of linter is only used to link it into the sdk. Note that it would be a normal package if it'd become an anlyzer plugin. |
Yes, but that comes with other costs, and it isn't clear to me that that's the best path forward for our users. |
Since @pq has been working on deprecation recently, what say we deprecate |
Sounds reasonable. And if we do that, then I'm going to want us to have a way to implement a quick-fix to change the name for users, which our current deprecation support doesn't include. |
Other operations we might want to either roll into the existing lints or define new lints for: Map.containsKey(Object? key)
Map.containsValue(Object? value)
Map.operator[Object? value]
Set.contains(Object? value)
Set.lookup(Object? object)
Set.remove(Object? value) |
The complete list (as I see it) would be: Iterable.contains(Object?) // inherited by List/Set/Queue too
List.remove(Object?)
Set.remove(Object?)
Set.lookup(Object?)
Set.containsAll(Iterable<Object?>)
Map.remove(Object?)
Map.containsKey(Object?)
Map.containsValue(Object?)
Map.operator [](Object?)
Queue.remove(Object?) I've omitted the following: Set.removeAll(Iterable<Object?>)
Set.retainAll(Iterable<Object?>)
Set.intersection(Set<Object?>)
Set.difference(Set<Object?>) The (I have also changed |
Complete with dart-lang/linter#3692 |
The text was updated successfully, but these errors were encountered: