Skip to content

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Aug 14, 2025

This is a narrow change to address a user
reported issue on System.Type and the
common implementation detail type, RuntimeType.

There are other related issues that discuss the underlying
Reflection behavior, see #98533 and #28056.

Fixes #118677

This is a narrow change to address a user
reported issue on System.Runtime and the
common implementation detail, System.RuntimeType.
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 10.0.0 milestone Aug 14, 2025
@AaronRobinsonMSFT AaronRobinsonMSFT changed the title Rename IsInterface to avoid Reflection issues Rename RuntimeType.IsInterface to avoid Reflection issues Aug 14, 2025
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 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

@AaronRobinsonMSFT AaronRobinsonMSFT changed the title Rename RuntimeType.IsInterface to avoid Reflection issues Rename RuntimeType.IsInterface to avoid issues with Reflection Aug 14, 2025
@AaronRobinsonMSFT
Copy link
Member Author

@jkotas This seems to be all known errors, so "green".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetProperties and GetProperty returning different answers in .NET 9 even with BindingFlags.FlattenHierarchy
2 participants