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 S107 FN: support primary constructors #8143

Closed
cristian-ambrosini-sonarsource opened this issue Oct 4, 2023 · 0 comments · Fixed by #8145
Closed

Fix S107 FN: support primary constructors #8143

cristian-ambrosini-sonarsource opened this issue Oct 4, 2023 · 0 comments · Fixed by #8145
Assignees
Labels
Area: C#12 C#12 related issues Type: False Negative Rule is NOT triggered when it should be.
Milestone

Comments

@cristian-ambrosini-sonarsource
Copy link
Contributor

The rule does not take into account a long parameter list on primary constructors.

public class MyWrongClass(int p1, int p2, int p3, int p4) { } // FN {{Constructor has 4 parameters, which is greater than the 3 authorized.}}

public class SubClass(int p1, int p2, int p3, int p4) : MyWrongClass(p1, p2, p3, p4) { } // Compliant: base class requires them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C#12 C#12 related issues Type: False Negative Rule is NOT triggered when it should be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants