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

Suggestion: analyzer for catching parameter name changes in overrides #19600

Closed
jcouv opened this issue May 17, 2017 · 2 comments
Closed

Suggestion: analyzer for catching parameter name changes in overrides #19600

jcouv opened this issue May 17, 2017 · 2 comments
Labels
Area-IDE Feature Request Resolution-External The behavior lies outside the functionality covered by this repository

Comments

@jcouv
Copy link
Member

jcouv commented May 17, 2017

public class Base
{
    public virtual void M(int a) { }
}
public class Derived : Base
{
    public override void M(int b) { } // changing the name is technically allowed but not recommended
}

As we discussed today in LDM, the language allows it, but except for some rare cases (names which cannot be spoken in C#, from PE produced by other languages), users generally expect the names to match.
Sounds like the job for an analyzer.

@CyrusNajmabadi FYI

@sharwell
Copy link
Member

Related issues:

tl;dr: This was proposed (@sharwell) and implemented (@pdelvo) for StyleCop Analyzers, and then one of our other developers (@vweijsters) implemented the equivalent rule CA1725 for roslyn-analyzers and it's already merged.

@sharwell sharwell added the Resolution-External The behavior lies outside the functionality covered by this repository label May 17, 2017
@jcouv
Copy link
Member Author

jcouv commented May 17, 2017

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request Resolution-External The behavior lies outside the functionality covered by this repository
Projects
None yet
Development

No branches or pull requests

2 participants