Skip to content
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

Add GetDeclaringType to PropertyDefinition and EventDefinition. #111646

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

teo-tsirpanis
Copy link
Contributor

Fixes #60380. Implementation follows the corresponding methods for method and field definitions, except that the binary search is performed on rows of the PropertyMap and EventMap tables for properties and fields respectively.

Copy link

Note regarding the new-api-needs-documentation label:

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.

Copy link

Note regarding the new-api-needs-documentation label:

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.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 21, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.

@teo-tsirpanis teo-tsirpanis requested a review from Copilot January 21, 2025 00:53

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (4)

src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/PropertyDefinition.cs:72

  • The new method GetDeclaringType should be covered by tests to ensure its correctness.
public TypeDefinitionHandle GetDeclaringType()

src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.cs:1370

  • Ensure that the new method GetDeclaringType for PropertyDefinitionHandle is covered by tests.
return PropertyMapTable.FindTypeContainingProperty(propertyDef.RowId, PropertyTable.NumberOfRows);

src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.cs:1360

  • Ensure that the new method GetDeclaringType for EventDefinitionHandle is covered by tests.
return EventMapTable.FindTypeContainingEvent(eventDef.RowId, EventTable.NumberOfRows);

src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/EventDefinition.cs:60

  • The new method GetDeclaringType should be covered by tests to ensure it works as expected.
public TypeDefinitionHandle GetDeclaringType()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Add GetDeclaringType to PropertyDefinition and EventDefinition
1 participant