-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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 back EnumBuilder.CreateType() #46681
Comments
@eerhardt are you planning to send a PR assuming this gets approved? I'll put this into 6.0 backlog for now. |
I can, yes. |
namespace System.Reflection.Emit
{
public sealed partial class EnumBuilder : TypeInfo
{
public Type? CreateType();
}
} |
@eerhardt And where should this be added if it exist in coreclr, but in corelib EnumBuilder is absent full...? |
It's already in the implementation: runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs Line 49 in 11cd272
runtime/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.Mono.cs Line 196 in 11cd272
It just needs to be added to the ref assembly (and tests added).
|
Background and Motivation
.NET Framework has the following APIs:
In .NET 5 we have:
To be consistent with both .NET Framework, and between EnumBuilder and TypeBuilder, we should add back the
CreateType()
method on EnumBuilder.Proposed API
namespace System.Reflection.Emit { public sealed class EnumBuilder : System.Reflection.TypeInfo { + public System.Type? CreateType() { throw null; } public System.Reflection.TypeInfo? CreateTypeInfo() { throw null; } }
Usage Examples
cc @terrajobst
The text was updated successfully, but these errors were encountered: