Skip to content
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

Update S4018: Improve rule message #6636

Closed
zsolt-kolbay-sonarsource opened this issue Jan 16, 2023 · 0 comments · Fixed by #6640
Closed

Update S4018: Improve rule message #6636

zsolt-kolbay-sonarsource opened this issue Jan 16, 2023 · 0 comments · Fixed by #6640
Assignees
Labels
Area: C# C# rules related issues.
Milestone

Comments

@zsolt-kolbay-sonarsource
Copy link
Contributor

S4018 was introduced to encourage the use of generic methods which can be called using type inference (the type parameters don't have to be explicitly specified during invocation).
The rule issues the message "Refactor this method to have parameters matching all the type parameters." when it encounters such method declarations. This doesn't show the reason why the programmer should change the method signature.

Recommendation: change the rule's message to "Use all type parameters in the parameter list to enable type inference."

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource moved this from To do to Review in progress in Best Kanban Jan 16, 2023
@andrei-epure-sonarsource andrei-epure-sonarsource moved this from Review in progress to In progress in Best Kanban Jan 16, 2023
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource moved this from In progress to Review in progress in Best Kanban Jan 16, 2023
Best Kanban automation moved this from Review in progress to Validate Peach Jan 17, 2023
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource moved this from Validate Peach to Done in Best Kanban Jan 31, 2023
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource added this to the 8.52 milestone Jan 31, 2023
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource changed the title S4018 Rule message does not reflect the rule's original intent Update S4018: Improve rule message Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues.
Projects
Best Kanban
  
Done
Rule Specification
Awaiting triage
Development

Successfully merging a pull request may close this issue.

1 participant