Skip to content

Commit

Permalink
Add reproducer for #6823 (#6824)
Browse files Browse the repository at this point in the history
* Add repro for issue 6823

* update UT for codefix
  • Loading branch information
mary-georgiou-sonarsource committed Feb 28, 2023
1 parent 5c8e7e3 commit 59ce476
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Expand Up @@ -147,4 +147,15 @@ class X3 : X2, IMyInt // Compliant
}

struct RedunantInterfaceImpl : IA { } // Fixed

// Reproducer for FP: https://github.com/SonarSource/sonar-dotnet/issues/6823
class Foo { }

interface IBar
{
int Test();
}

class Bar : Foo { } // Error [CS0535]
// Fixed
}
Expand Up @@ -160,4 +160,15 @@ class X3 : X2, IMyInt // Compliant

struct RedunantInterfaceImpl : IA, IBase { } // Noncompliant {{'IA' implements 'IBase' so 'IBase' can be removed from the inheritance list.}}
// ^^^^^^^

// Reproducer for FP: https://github.com/SonarSource/sonar-dotnet/issues/6823
class Foo { }

interface IBar
{
int Test();
}

class Bar : Foo, IBar { } // Error [CS0535]
// Noncompliant@-1 {{'Foo' implements 'IBar' so 'IBar' can be removed from the inheritance list.}} FP
}

0 comments on commit 59ce476

Please sign in to comment.