-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix Type.IsVisible and Type.ContainsGenericParameters for function pointers #122224
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
Conversation
…rameters Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
|
Tagging subscribers to this area: @dotnet/area-system-reflection |
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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 fixes bugs in the abstract implementations of Type.IsVisible and Type.ContainsGenericParameters that caused incorrect results for function pointer types in NativeAOT.
Key Changes:
- Added function pointer handling to
ContainsGenericParametersto check return and parameter types - Added function pointer handling to
IsVisibleto validate visibility of return and parameter types - Added comprehensive test coverage for function pointer visibility scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/libraries/System.Private.CoreLib/src/System/Type.Helpers.cs | Adds function pointer checks to ContainsGenericParameters and IsVisible properties to recursively validate return and parameter types |
| src/libraries/Common/tests/System/FunctionPointerTests.cs | Adds FunctionPointerVisibility test with scenarios for public/private return types and parameters, plus supporting test fields in FunctionPointerHolder |
Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Type/TypeTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Type/TypeTests.cs
Outdated
Show resolved
Hide resolved
…/Type/TypeTests.cs
…o inherit from Type directly Co-authored-by: jkotas <[email protected]>
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Type/TypeTests.cs
Outdated
Show resolved
Hide resolved
…ericParameters Co-authored-by: jkotas <[email protected]>
Type.IsVisibleandType.ContainsGenericParametersdon't handle function pointers correctlyContainsGenericParametersin Type.Helpers.cs to check function pointer return and parameter typesIsVisiblein Type.Helpers.cs to check function pointer return and parameter typesOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.