-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Add neutral model for System.ComponentModel.PropertyDescriptor.GetValue
#20627
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
C#: Add neutral model for System.ComponentModel.PropertyDescriptor.GetValue
#20627
Conversation
49f2c4d to
2577452
Compare
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.
Pull Request Overview
This PR disables the automatically generated flow summary for System.ComponentModel.PropertyDescriptor.GetValue by adding a neutral model. The change prevents potential type safety issues where the method's object -> object signature could lead to incorrect upcasting and downcasting of known specific types to incompatible property types.
- Adds a manual neutral model for
PropertyDescriptor.GetValueto override the auto-generated flow summary - Removes the problematic
dfc-generatedflow summaries from test expectations for bothSystem.ComponentModel.PropertyDescriptorandNewtonsoft.Json.Linq.JPropertyDescriptor
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| System.ComponentModel.model.yml | Adds neutral model configuration to disable flow summary for PropertyDescriptor.GetValue |
| FlowSummaries.expected | Updates test expectations by removing auto-generated summaries and adding neutral model entries |
| FlowSummariesFiltered.expected | Removes the filtered flow summary entry for PropertyDescriptor.GetValue |
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
aschackmull
left a comment
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.
LGTM
|
Dca shows zero impact. Merging. |
This PR disables the flow-generated summary for
PropertyDescriptor.GetValue. The problem with this summary is that it has typeobject -> object, which means that we risk first upcasting a known specific typettoobject, and then subsequently downcasting it to a different type, which does not correspond to the type of any property oft.