-
Notifications
You must be signed in to change notification settings - Fork 4.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
Update CustomValidationAttribute ref to include missing properties #91441
Update CustomValidationAttribute ref to include missing properties #91441
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-componentmodel-dataannotations Issue DetailsAfter applying Fix nullable annotation for Validator.ValidateValue ref source · Pull Request #91351, I reran Since this is a pretty esoteric scenario and not reported by any customers, I figured we'd just fix this in net9.
|
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.
Interesting, it looks like the appcompat tool doesn't detect the overridden members?
@@ -65,6 +65,8 @@ public sealed partial class CustomValidationAttribute : System.ComponentModel.Da | |||
{ | |||
public CustomValidationAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type validatorType, string method) { } | |||
public string Method { get { throw null; } } | |||
public override bool RequiresValidationContext { get { throw null; } } | |||
public override object TypeId { get { throw null; } } |
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.
CustomValidationAttribute is sealed, so these technically aren't necessary. Overrides need to be in the ref so that a derived type doing base.Member
will call to the override rather than skipping it, but that's not an issue on sealed types.
That's probably dotnet/sdk#24390. |
As noted in #91441 (comment), there isn't actually compat risk to adding or removing these, nor is there a technical benefit to doing so, because the type is sealed. If there's a special mode for flagging all discrepancies, these could be included, but we've frequently removed (or not added) overrides on sealed types in the refs. |
Closing without merging since there's no benefit in adding these in. |
After applying Fix nullable annotation for Validator.ValidateValue ref source · Pull Request #91351, I reran
dotnet msbuild /t:GenerateReferenceAssemblySource
, and it picked up on 2 properties missing from the ref source forCustomValidationAttribute
.Since this is a pretty esoteric scenario and not reported by any customers, I figured we'd just fix this in net9.