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

SA1516 reported twice for the same location in top-level statements #3492

Closed
bjornhellander opened this issue Apr 24, 2022 · 1 comment
Closed

Comments

@bjornhellander
Copy link
Contributor

In a comment to #3482, @sharwell noted that some unit tests were expecting two diagnostics for the same location in top-level statements like this:

return 0;
record A(); // Reported twice on the first character of this line

I have debugged a little and see that HandleCompilationUnit in SA1516ElementsMustBeSeparatedByBlankLine is called twice in those tests. The second call only seems to happen on code using top-level statements.

@bjornhellander bjornhellander changed the title SA1516 reported twice for the same location SA1516 reported twice for the same location in top-level statements Apr 24, 2022
@bjornhellander
Copy link
Contributor Author

Seems to be bug in earlier Roslyn versions. It is only reported once in the new c# 11 test project (PR #3491).

@sharwell sharwell closed this as completed May 3, 2022
@sharwell sharwell closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants