-
Notifications
You must be signed in to change notification settings - Fork 166
Fix false negative in avoid_types_as_parameter_names
#2823
Fix false negative in avoid_types_as_parameter_names
#2823
Conversation
bwilkerson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that looks good, thanks.
scheglov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I'd be happy to land this, but I'll need conflicts resolved in order to test inside Google first. |
…eter_names # Conflicts: # lib/src/rules/avoid_types_as_parameter_names.dart
|
Conflicts resolved, thanks. |
|
Thanks! Comically, there are a lot of breakages internally; 99% of them are parameters of the form |
|
If there are both a type and a name, then it seems reasonable that this lint not fire. As I recall, the motivation for this lint was to prevent cases where someone wrote a type name and forgot to write a parameter name, which clearly isn't the case if the parameter name is there. |
|
In that case, we might be able to just revert the deleted (There were other breakages in google3 I'll clean up first) |
|
Ah, now we should change those test cases to have implicit parameter types, if possible. I think the function-typed ones cannot have implicit types. So in |
|
I see, PTAL. |
|
I'm still working on cleaning this one up internally. |
|
We are now clean internally. |
|
@srawlins: did you happen to look at Flutter too? (No worries either way...) |
|
Not yet. I hope have a moment this week. 🤞 |
|
@srawlins: you asked for a change... I think it's done? |
|
Yes, the one change I requested is done. |
pq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…linter#2823) * Fix false negative in `avoid_types_as_parameter_names` * use visitGenericFunctionType * Remove visitGenericFunctionType * Merge and removed sections done for a now fixed issue. * Lint for implicit types. * Make tests has implicit parameter types
Covers the cases for dart-lang/sdk#58453
I am not sure about the documentation request, since this is a test case