-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
CA1852 doesn't make sense for top-level statements #33297
Comments
@mavasani I think this should be transferred to the roslyn-analyzers repo. It looks like CA1852 is enabled with the "Recommended" rules for .NET 7. |
@Youssef1313 I think this was fixed recently, do you recall? |
Ah this is fixed with dotnet/roslyn-analyzers#6278 |
Thanks @mavasani. Can you edit the title of dotnet/roslyn-analyzers#6141 to say CA1852 instead of CS1852 so it comes up in a search? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
with the addition/recent change to CA1852 it is flagging that the program class needs to be sealed but if we are using Top-Level Statements there is no program class. Thus we have to add a pragma ignore for this new warning.
Version
.NET 7
Previous behavior
no warning
New behavior
warning
Type of breaking change
Reason for change
no idea
Recommended action
either fix top level statement hidden classes to be sealed or not based on this rule or fix the rule to recognize top level statements.
Feature area
C#, Code analysis
Affected APIs
No response
The text was updated successfully, but these errors were encountered: