Skip to content

Commit

Permalink
Add reproducer for #9011 (#9024)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-marichal authored Apr 4, 2024
1 parent ca876ae commit dd170e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ public void ClassShouldNotBeEmpty_CSharp10() =>
.WithOptions(ParseOptionsHelper.FromCSharp10)
.Verify();

[TestMethod]
public void ClassShouldNotBeEmpty_CSharp12() =>
builderCS
.AddPaths("ClassShouldNotBeEmpty.CSharp12.cs")
.WithOptions(ParseOptionsHelper.FromCSharp12)
.Verify();

[TestMethod]
public void ClassShouldNotBeEmpty_Inheritance_CS() =>
builderCS
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Collections.Generic;

public class TestCaseData(List<int> list, int expectedCount)
{
public List<int> List { get; }
public int ExpectedCount { get; }
}

// See https://github.com/SonarSource/sonar-dotnet/issues/9011
public class CountTestCaseData(List<int> list, int expectedCount) : TestCaseData(list, expectedCount); // Noncompliant - FP

0 comments on commit dd170e4

Please sign in to comment.