-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Rename RuntimeType.IsInterface
to avoid issues with Reflection
#118749
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
Rename RuntimeType.IsInterface
to avoid issues with Reflection
#118749
Conversation
This is a narrow change to address a user reported issue on System.Runtime and the common implementation detail, System.RuntimeType.
RuntimeType.IsInterface
to avoid Reflection issues
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 renames the internal IsInterface
property to IsActualInterface
across CoreCLR, NativeAot, and Mono runtimes to avoid reflection issues. The change addresses a user-reported issue where the IsInterface
property name conflicts with reflection behavior.
Key changes:
- Introduced
IsActualInterface
internal property in all runtime implementations - Updated all internal usages to use the new property name
- Fixed project file reference in NativeAot to use the correct source file
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs | Added IsActualInterface property that delegates to IsInterface |
src/libraries/System.Private.CoreLib/src/System/Type.cs | Updated to use IsActualInterface instead of IsInterface for RuntimeType |
src/libraries/System.Private.CoreLib/src/System/RuntimeType.cs | Updated three usages to call IsActualInterface |
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs | Updated validation logic to use IsActualInterface |
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeType.NativeAot.cs | Renamed IsInterface property to IsActualInterface |
src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj | Fixed file reference from RuntimeType.cs to RuntimeType.NativeAot.cs |
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs | Renamed IsInterface property to IsActualInterface and updated all usages |
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/DynamicInterfaceCastableHelpers.cs | Updated to use IsActualInterface |
src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs | Updated two usages to call IsActualInterface |
src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs | Updated two usages to call IsActualInterface |
RuntimeType.IsInterface
to avoid Reflection issuesRuntimeType.IsInterface
to avoid issues with Reflection
@jkotas This seems to be all known errors, so "green". |
This is a narrow change to address a user
reported issue on
System.Type
and thecommon implementation detail type,
RuntimeType
.There are other related issues that discuss the underlying
Reflection behavior, see #98533 and #28056.
Fixes #118677