-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
CLSCompliant(true) check for arrays as attribute arguments triggers on internal types #68526
Comments
I don't see any problem with making the change, especially for the |
My PR that fixes this uses the same accessibilty check as the rest of the CLS Compliance checking (such as for method signatures), so it should behave identically with respect to IVT. |
@jkoritzinsky Please include complete repro in the description. Links to external resources are good, but they are not a replacement. What would we do if that external resource disappears? Also, please include complete wording of the problematic diagnostic, I am pretty sure very small number of people remember what CS3016 is about. |
Updated the issue with the source and diagnostics inline in addition to the SharpLab link. |
Could you please clarify location for each of the warnings? |
Updated |
I think triage should decide what path we should take here. It appears, that originally Roslyn had the attribute check suppressed based on accessibility of the target. Then, we explicitly changed that behavior back to accessibility independent behavior. Do we want to flip back again after that many years? Apparently we had a good enough reason to end up where we are today with respect to the check. |
@AlekseyTs When did the behavior change? If it indeed was changed to the current behavior, it should probably be documented as by design and the suppression via the |
Related: #4293 |
Version Used: .NET 8.0.100 P4 SDK
Steps to Reproduce:
Warnings:
If the
CLSCompliant(false)
attribute is removed, then a secondCS3016
diagnostic is reported instead ofCS3019
.SharpLab link
This is particularly rough for
file
-scoped types that can't be madepartial
.Diagnostic Id: CS3016
Expected Behavior:
No CLS compliance warnings on array attribute parameters on attributes on non-exposed types.
Actual Behavior:
CLS compliance warnings on array attribute parameters on attributes on non-exposed types, and CS3019 if I put
CLSCompliant(false)
on the type with the attribute.The text was updated successfully, but these errors were encountered: