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

RS0046 should ignore implementations with matching names #3814

Closed
sharwell opened this issue Jul 2, 2020 · 1 comment · Fixed by #3815
Closed

RS0046 should ignore implementations with matching names #3814

sharwell opened this issue Jul 2, 2020 · 1 comment · Fixed by #3815
Labels
Area-Roslyn.Diagnostics.Analyzers Bug The product is not behaving according to its current intended design

Comments

@sharwell
Copy link
Member

sharwell commented Jul 2, 2020

Analyzer package

Roslyn.Diagnostics.Analyzers

Package Version

3.3.0-beta1.20262.5

Diagnostic ID

RS0046

Repro steps

abstract class Base
{
  public abstract void Method(TextSpan? selectionOpt);
}

class Derived : Base
{
  public override void Method(TextSpan? selectionOpt) { }
}

Expected behavior

RS0046 is reported on Base.Method.

Actual behavior

RS0046 is reported on both Base.Method and Derived.Method.

Additional details

  • This exclusion should apply to both interface implementations and overriding members.
  • The exclusion only applies when the implementation parameter name is the same as the base parameter name. If the parameter names do not match, the implementation will report a warning if applicable.
@sharwell sharwell added Bug The product is not behaving according to its current intended design Area-Roslyn.Diagnostics.Analyzers labels Jul 2, 2020
@Evangelink
Copy link
Member

I feel so stupid to have missed this obvious case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Roslyn.Diagnostics.Analyzers Bug The product is not behaving according to its current intended design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants