Skip to content

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Oct 12, 2025

This PR disables the flow-generated summary for PropertyDescriptor.GetValue. The problem with this summary is that it has type object -> object, which means that we risk first upcasting a known specific type t to object, and then subsequently downcasting it to a different type, which does not correspond to the type of any property of t.

@github-actions github-actions bot added the C# label Oct 12, 2025
@hvitved hvitved force-pushed the csharp/property-descriptor-get-value-neutral branch from 49f2c4d to 2577452 Compare October 12, 2025 07:07
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Oct 12, 2025
@hvitved hvitved marked this pull request as ready for review October 12, 2025 13:21
@hvitved hvitved requested a review from a team as a code owner October 12, 2025 13:21
@hvitved hvitved requested review from Copilot and removed request for a team October 12, 2025 13:21
Copy link
Contributor

@Copilot Copilot AI left a 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.GetValue to override the auto-generated flow summary
  • Removes the problematic dfc-generated flow summaries from test expectations for both System.ComponentModel.PropertyDescriptor and Newtonsoft.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant