You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
EnumBuildereb=...;// Define two members, "High" and "Low".eb.DefineLiteral("Low",0);eb.DefineLiteral("High",1);// Create the type and save the assembly.Typefinished=eb.CreateType();
Activity
krwq commentedon Feb 16, 2021
@eerhardt are you planning to send a PR assuming this gets approved? I'll put this into 6.0 backlog for now.
eerhardt commentedon Feb 16, 2021
I can, yes.
terrajobst commentedon Feb 23, 2021
Video
I-SER-I commentedon Mar 6, 2021
@eerhardt And where should this be added if it exist in coreclr, but in corelib EnumBuilder is absent full...?
stephentoub commentedon Mar 6, 2021
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).
runtime/src/libraries/System.Reflection.Emit/ref/System.Reflection.Emit.cs
Line 110 in 11cd272
Add EnumBuilder.CreateType back in the public API
Add EnumBuilder.CreateType back in the public API (#49319)