-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Proposal: obsolete or hide TypeInfo/GetTypeInfo #53217
Comments
cc @steveharter @GrabYourPitchforks thoughts? |
I agree with the proposal, especially given that The original rationale for |
I agree in spirit with the idea of obsoleting or hiding Since |
I appreciate the hesitation that @GrabYourPitchforks expressed. If the type is used in non-obsolete APIs, then we should not obsolete it. Therefore this proposal would also need to include identification of all such APIs in the .NET Libraries and assessing if it's feasible to add method overloads and replacement properties. Depending on the surface area affected by that, we'd either conclude it to be low enough impact to proceed, or too disruptive. |
I suggest we start with a code fixer that replaces |
The usage of |
Yeah, we can't do that. External folks don't inherit from |
@terrajobst the analyzer proposal is ready for review #61122, we might want to mark this one ready for review too |
namespace System.Reflection
{
+ [EditorBrowsable(Never)]
public static class IntrospectionExtensions
{
+ [EditorBrowsable(Never)]
public static TypeInfo GetTypeInfo(this Type type);
}
} |
That's fair. Couple of other questions:
|
Don't obsolete CustomAttributeExtensions. It defines GetCustomAttribute<T> and GetCustomAttributes<T> extension methods that are useful and do not exist as instance methods. |
Moving to 9; should be simple but there are the questions stated above about expanding the scope here around other types and extension methods. |
Background and Motivation
#53113
TypeInfo
was introduced in .NET of Windows Store, for limited reflection. Nowadays in .NET Core, it has no feature difference withType
. To avoid confusing, we can hide or obsolete the type and tell people to useType
directly.Proposed API
Usage Examples
N/A
Alternative Designs
N/A
Risks
There is also a public interface
IReflectableType
. Can there be custom implementation of it? Does it need to be hidden/obsoleted?The text was updated successfully, but these errors were encountered: