-
Notifications
You must be signed in to change notification settings - Fork 467
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
[release/7.0.1xx] SealInternalTypes (CA1852): Don't warn for top-level type (#6278) #6504
Conversation
* SealInternalTypes (CA1852): Don't warn for top-level type * Fix build errors
@jhartmann123 personally I am supportive to port, but for porting fixes into SDK servicing releases we need to get approval from management. I will update the description with the info needed for servicing request, we need more info from you to fill the |
I'm sorry, while not stated explicitly anywhere, some people, including me, were under the impression that this was planned to be fixed with SDK 7.0.1xx. As it still wasn't fixed with 7.0.200, I thought that this was just a missed cherry pick... Thanks for updating the MR description, I've added our issue with this in the Customer impact part. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backporting this to 7.0.x sounds good to me. It addresses a common scenario of top-level statements where a bug exists and cannot be satisfactorily worked around.
@buyaa-n Can you shepherd this through Tactics please?
Hm, could not merge, probably because of the failure? Rerunning did not work, closing and reopening the PR |
Backport #6278 into the .NET7 release branch
Issue: #6141 - CA1852 warns on generated Program for top-level statements
Customer Impact
The CA1852 analyzer is hidden by default, but it is bulk configurable. Which means it is will be on if user choose to warn on all analyzers or on
Performance
category analyzers. Several customers asked about the porting in the issue #6141. For the customer who opened this PR they have all analyzers enabled withTreatWarningsAsErrors
set to true in their project. So, they explicitly have to suppress this analyzer in order to compile. There is no workaround except suppressing the warning or upgrading to .NET 8 previews which is not desirable. Accounting that top level statements are getting more and more popular the fix better to be serviced in 7.0.Regression
No, but if we account that the analyzer newly added in 7.0 with the bug it could cause an unexpected warning when the analyzers bulk configured to
Warn
Testing
Risk
Very low, the fix is quite simple and self-descriptive. It would not introduce a new warning nor would affect any other code/analyzer.
CC @jeffhandley @stephentoub