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

Fix S1186 FP: Empty method comes from interface #7629

Closed
hankovich opened this issue Jul 20, 2023 · 1 comment · Fixed by #7658
Closed

Fix S1186 FP: Empty method comes from interface #7629

hankovich opened this issue Jul 20, 2023 · 1 comment · Fixed by #7658
Assignees
Labels
Area: C# C# rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@hankovich
Copy link

Description

S1186 is reported for empty methods that implement interface

Repro steps

interface IFilter
{
    void OnEnter();

    void OnExit();
}

class Filter : IFilter
{
    public void OnEnter() // <- is reported here
    {
    }

    public void OnExit()
    {
        Console.WriteLine("exiting");
    }
}

Expected behavior

No diagnostic is reported

Actual behavior

Diagnostic is reported

Related information

  • C#/VB.NET Plugins version 9.5.0.73987
  • Visual Studio version latest preview
  • MSBuild / dotnet version .NET 8 preview 6
@cristian-ambrosini-sonarsource
Copy link
Contributor

Hi @hankovich, thank you for reporting this. I confirmed it as False Positive.

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. Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants