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

Missing SA1212 on init accessor #3652

Closed
bjornhellander opened this issue May 7, 2023 · 0 comments · Fixed by #3661
Closed

Missing SA1212 on init accessor #3652

bjornhellander opened this issue May 7, 2023 · 0 comments · Fixed by #3661

Comments

@bjornhellander
Copy link
Contributor

public class TestClass
{
    public int X { set; get; } // Triggers SA1212
    public int Y { init; get; } // Does NOT trigger SA1212!
}

I expect SA1212 ("A get accessor appears after a set accessor within a property or indexer") to trigger on both properties above, but it does not. That is, I expect init and set to be treated the same way in this rule.
Tested with 1.2.0-beta.435.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants