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 S3253 FN: primary parameterless constructors #8092

Closed
antonioaversa opened this issue Sep 27, 2023 · 0 comments · Fixed by #8227
Closed

Fix S3253 FN: primary parameterless constructors #8092

antonioaversa opened this issue Sep 27, 2023 · 0 comments · Fixed by #8227
Assignees
Labels
Area: C#12 C#12 related issues Type: False Negative Rule is NOT triggered when it should be.
Milestone

Comments

@antonioaversa
Copy link
Contributor

antonioaversa commented Sep 27, 2023

Primary parameterless constructors are redundant as parameterless constructors and should be reported by S3253.

class AClassWithBody() { }                // FN
class AClassWithoutBody();                // FN
struct AStructWithBody() { }              // FN
struct AStructWithoutBody();              // FN
record ARecordWithBody() { }              // FN
record ARecordWithoutBody();              // FN
record struct ARecordStructWithBody() { } // FN
record struct ARecordStructWithoutBody(); // FN

Alternative: extend S3235 instead.

@antonioaversa antonioaversa added Type: False Negative Rule is NOT triggered when it should be. Area: C#12 C#12 related issues labels Sep 27, 2023
antonioaversa added a commit that referenced this issue Sep 27, 2023
antonioaversa added a commit that referenced this issue Sep 28, 2023
antonioaversa added a commit that referenced this issue Sep 28, 2023
antonioaversa added a commit that referenced this issue Sep 29, 2023
@sebastien-marichal sebastien-marichal removed their assignment Oct 19, 2023
@andrei-epure-sonarsource andrei-epure-sonarsource added this to the 9.13 milestone Oct 31, 2023
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.

4 participants