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 S2234 FN: primary constructors for records, classes and structs #8071

Closed
antonioaversa opened this issue Sep 25, 2023 · 0 comments · Fixed by #8238
Closed

Fix S2234 FN: primary constructors for records, classes and structs #8071

antonioaversa opened this issue Sep 25, 2023 · 0 comments · Fixed by #8238
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 25, 2023

S2234

class Base(int a, int b)
{
    Base(int a, int b, int c) : this(b, a) { }  // FN: primary ctor params inverted
}

class Derived(int a, int b) : Base(b, a);       // FN: ctor params inverted

Related issues:

@antonioaversa antonioaversa added Type: False Negative Rule is NOT triggered when it should be. Area: C#12 C#12 related issues labels Sep 25, 2023
@antonioaversa antonioaversa changed the title Fix S2234 FN: Primary constructors Fix S2234 FN: Primary constructors for records, classes and structs Sep 25, 2023
antonioaversa added a commit that referenced this issue Sep 26, 2023
@antonioaversa antonioaversa changed the title Fix S2234 FN: Primary constructors for records, classes and structs Fix S2234 FN: primary constructors for records, classes and structs Sep 26, 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