Skip to content

[API Proposal]: Abstract System.Reflection.Emit public types #78542

Closed

Description

We plan to abstract out Reflection.Emit APIs as preparation for adding AssemblyBuilder.Save() equivalent in .NET Core. So that we can have two implementations, one that having old code to support all downlevel runtime, and a new implementation that replaces the current Reflection.Emit implementation.
UPDATE: Link to Updated Proposal

namespace System.Reflection.Emit
{
-    public sealed partial class AssemblyBuilder : System.Reflection.Assembly
+    public abstract partial class AssemblyBuilder : System.Reflection.Assembly
    {
-        internal AssemblyBuilder();
+        protected AssemblyBuilder();
-        public System.Reflection.Emit.ModuleBuilder DefineDynamicModule(string name);
+        public abstract System.Reflection.Emit.ModuleBuilder DefineDynamicModule(string name);
-        public System.Reflection.Emit.ModuleBuilder? GetDynamicModule(string name);
+        public abstract System.Reflection.Emit.ModuleBuilder? GetDynamicModule(string name);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
   }
       
-    public sealed partial class ConstructorBuilder : System.Reflection.ConstructorInfo
+    public abstract partial class ConstructorBuilder : System.Reflection.ConstructorInfo
    {
-        internal ConstructorBuilder();
+        protected ConstructorBuilder();
-        public bool InitLocals { get; set; }
+        public abstract bool InitLocals { get; set; }
-        public System.Reflection.Emit.ParameterBuilder DefineParameter(int iSequence, System.Reflection.ParameterAttributes attributes, string? strParamName);
+        public abstract System.Reflection.Emit.ParameterBuilder DefineParameter(int iSequence, System.Reflection.ParameterAttributes attributes, string? strParamName);
-        public System.Reflection.Emit.ILGenerator GetILGenerator();
+        public abstract ILGenerator GetILGenerator();
-        public System.Reflection.Emit.ILGenerator GetILGenerator(int streamSize);
+        public abstract System.Reflection.Emit.ILGenerator GetILGenerator(int streamSize);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract  void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetImplementationFlags(System.Reflection.MethodImplAttributes attributes;
+        public abstract void SetImplementationFlags(System.Reflection.MethodImplAttributes attributes);
    }
    
-    public sealed partial class EnumBuilder : System.Reflection.TypeInfo
+    public abstract partial class EnumBuilder : System.Reflection.TypeInfo
    {
-        internal EnumBuilder();
+        protected EnumBuilder();
-        public System.Reflection.Emit.FieldBuilder UnderlyingField { get; }
+        public abstract System.Reflection.Emit.FieldBuilder UnderlyingField { get ; }
-        public System.Reflection.TypeInfo CreateTypeInfo();
+        public abstract System.Reflection.TypeInfo CreateTypeInfo();
-        public System.Reflection.Emit.FieldBuilder DefineLiteral(string literalName, object? literalValue);
+        public abstract System.Reflection.Emit.FieldBuilder DefineLiteral(string literalName, object? literalValue);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
    }
    
-    public sealed partial class EventBuilder
+    public abstract partial class EventBuilder
    {
-        internal EventBuilder();
+        protected EventBuilder();
-        public void AddOtherMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
+        public abstract void AddOtherMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
-        public void SetAddOnMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
+        public abstract void SetAddOnMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetRaiseMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
+        public abstract void SetRaiseMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
-        public void SetRemoveOnMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
+        public abstract void SetRemoveOnMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
    }
    
-    public sealed partial class FieldBuilder : System.Reflection.FieldInfo
+    public abstract partial class FieldBuilder : System.Reflection.FieldInfo
    {
-        internal FieldBuilder();
+        protected FieldBuilder();
-        public void SetConstant(object? defaultValue);
+        public abstract void SetConstant(object? defaultValue);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder)
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetOffset(int iOffset);
+        public abstract void SetOffset(int iOffset);
    }
    
-    public sealed partial class GenericTypeParameterBuilder : System.Reflection.TypeInfo
+    public abstract partial class GenericTypeParameterBuilder : System.Reflection.TypeInfo
    {
-        internal GenericTypeParameterBuilder();
+        protected GenericTypeParameterBuilder();
-         public void SetBaseTypeConstraint([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? baseTypeConstraint);
+        public abstract void SetBaseTypeConstraint([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? baseTypeConstraint);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetGenericParameterAttributes(System.Reflection.GenericParameterAttributes genericParameterAttributes);
+        public abstract void SetGenericParameterAttributes(System.Reflection.GenericParameterAttributes genericParameterAttributes);
-        public void SetInterfaceConstraints(params System.Type[]? interfaceConstraints);
+        public abstract void SetInterfaceConstraints(params System.Type[]? interfaceConstraints);
    }
    
-    public sealed partial class MethodBuilder : System.Reflection.MethodInfo
+    public abstract partial class MethodBuilder : System.Reflection.MethodInfo
    {
-        internal MethodBuilder();
+        protected MethodBuilder();
-        public bool InitLocals { get; set; }
+        public abstract bool InitLocals { get; set; }
-        public System.Reflection.Emit.GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names);
+        public abstract System.Reflection.Emit.GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names);
-        public System.Reflection.Emit.ParameterBuilder DefineParameter(int position, System.Reflection.ParameterAttributes attributes, string? strParamName);
+        public abstract System.Reflection.Emit.ParameterBuilder DefineParameter(int position, System.Reflection.ParameterAttributes attributes, string? strParamName);
-        public System.Reflection.Emit.ILGenerator GetILGenerator();
+        public abstract System.Reflection.Emit.ILGenerator GetILGenerator();
-        public System.Reflection.Emit.ILGenerator GetILGenerator(int size);
+        public abstract System.Reflection.Emit.ILGenerator GetILGenerator(int size);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetImplementationFlags(System.Reflection.MethodImplAttributes attributes);
+        public abstract void SetImplementationFlags(System.Reflection.MethodImplAttributes attributes);
-        public void SetParameters(params System.Type[] parameterTypes);
+        public abstract void SetParameters(params System.Type[] parameterTypes);
-        public void SetReturnType(System.Type? returnType);
+        public abstract void SetReturnType(System.Type? returnType);
-        public void SetSignature(System.Type? returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers);
+        public abstract void SetSignature(System.Type? returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers);
    }
    
-    public partial class ModuleBuilder : System.Reflection.Module
+    public abstract partial class ModuleBuilder : System.Reflection.Module
    {
-        internal ModuleBuilder();
+        protected ModuleBuilder();
-        public void CreateGlobalFunctions();
+        public abstract void CreateGlobalFunctions();
-        public System.Reflection.Emit.EnumBuilder DefineEnum(string name, System.Reflection.TypeAttributes visibility, System.Type underlyingType);
+        public abstract System.Reflection.Emit.EnumBuilder DefineEnum(string name, System.Reflection.TypeAttributes visibility, System.Type underlyingType);
-        public System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? requiredReturnTypeCustomModifiers, System.Type[]? optionalReturnTypeCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? requiredParameterTypeCustomModifiers, System.Type[][]? optionalParameterTypeCustomModifiers);
+        public abstract System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? requiredReturnTypeCustomModifiers, System.Type[]? optionalReturnTypeCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? requiredParameterTypeCustomModifiers, System.Type[][]? optionalParameterTypeCustomModifiers);
-        public System.Reflection.Emit.FieldBuilder DefineInitializedData(string name, byte[] data, System.Reflection.FieldAttributes attributes) ;
+        public abstract System.Reflection.Emit.FieldBuilder DefineInitializedData(string name, byte[] data, System.Reflection.FieldAttributes attributes);
-        public System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);
+        public abstract System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);
-        public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Reflection.Emit.PackingSize packingSize, int typesize);
+        public abstract System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Reflection.Emit.PackingSize packingSize, int typesize);
-        public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Type[]? interfaces);
+        public abstract System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Type[]? interfaces);
-        public System.Reflection.Emit.FieldBuilder DefineUninitializedData(string name, int size, System.Reflection.FieldAttributes attributes);
+        public abstract System.Reflection.Emit.FieldBuilder DefineUninitializedData(string name, int size, System.Reflection.FieldAttributes attributes);
-        public System.Reflection.MethodInfo GetArrayMethod(System.Type arrayClass, string methodName, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? parameterTypes);
+        public abstract System.Reflection.MethodInfo GetArrayMethod(System.Type arrayClass, string methodName, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? parameterTypes);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);

// New public APIs: these are existing internal methods used outside of the ModuleBuilder, so needs to make public 
+        public abstract int GetTypeToken(Type type);
+        public abstract int GetMethodToken(MethodInfo method);
+        public abstract int GetFieldToken(FieldInfo field);
+        public abstract int GetConstructorToken(ConstructorInfo con);
+        public abstract int GetSignatureToken(SignatureHelper sigHelper);
+        public abstract int GetStringConstant(string str);
    }
    
-    public sealed partial class PropertyBuilder : System.Reflection.PropertyInfo
+    public abstract partial class PropertyBuilder : System.Reflection.PropertyInfo
    {
-        internal PropertyBuilder();
+        protected PropertyBuilder();
-        public void AddOtherMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
+        public abstract void AddOtherMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
-        public void SetConstant(object? defaultValue);
+        public abstract void SetConstant(object? defaultValue);
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetGetMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
+        public abstract void SetGetMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
-        public void SetSetMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
+        public abstract void SetSetMethod(System.Reflection.Emit.MethodBuilder mdBuilder);
    }
   
-   public sealed partial class TypeBuilder : System.Reflection.TypeInfo
+   public abstract partial class TypeBuilder : System.Reflection.TypeInfo
    {
-        internal TypeBuilder();
+        protected TypeBuilder();
-        public System.Reflection.Emit.PackingSize PackingSize { get; }
+        public abstract System.Reflection.Emit.PackingSize PackingSize { get; }
-        public int Size { get; }
+        public abstract int Size { get; }
-        public void AddInterfaceImplementation([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type interfaceType);
+        public abstract void AddInterfaceImplementation([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type interfaceType);
-        public System.Reflection.TypeInfo CreateTypeInfo();
+        public abstract System.Reflection.TypeInfo CreateTypeInfo();
-        public System.Reflection.Emit.ConstructorBuilder DefineConstructor(System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type[]? parameterTypes, System.Type[][]? requiredCustomModifiers, System.Type[][]? optionalCustomModifiers);
+        public abstract System.Reflection.Emit.ConstructorBuilder DefineConstructor(System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type[]? parameterTypes, System.Type[][]? requiredCustomModifiers, System.Type[][]? optionalCustomModifiers);
-        public System.Reflection.Emit.ConstructorBuilder DefineDefaultConstructor(System.Reflection.MethodAttributes attributes);
+        public abstract System.Reflection.Emit.ConstructorBuilder DefineDefaultConstructor(System.Reflection.MethodAttributes attributes);
-        public System.Reflection.Emit.EventBuilder DefineEvent(string name, System.Reflection.EventAttributes attributes, System.Type eventtype);
+        public abstract System.Reflection.Emit.EventBuilder DefineEvent(string name, System.Reflection.EventAttributes attributes, System.Type eventtype);
-        public System.Reflection.Emit.FieldBuilder DefineField(string fieldName, System.Type type, System.Type[]? requiredCustomModifiers, System.Type[]? optionalCustomModifiers, System.Reflection.FieldAttributes attributes) { throw null; }
+        public abstract System.Reflection.Emit.FieldBuilder DefineField(string fieldName, System.Type type, System.Type[]? requiredCustomModifiers, System.Type[]? optionalCustomModifiers, System.Reflection.FieldAttributes attributes);
-        public System.Reflection.Emit.GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names);
+        public abstract System.Reflection.Emit.GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names);
-        public System.Reflection.Emit.FieldBuilder DefineInitializedData(string name, byte[] data, System.Reflection.FieldAttributes attributes);
+        public abstract System.Reflection.Emit.FieldBuilder DefineInitializedData(string name, byte[] data, System.Reflection.FieldAttributes attributes);
-        public System.Reflection.Emit.MethodBuilder DefineMethod(string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers);
+        public abstract System.Reflection.Emit.MethodBuilder DefineMethod(string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers);
-        public void DefineMethodOverride(System.Reflection.MethodInfo methodInfoBody, System.Reflection.MethodInfo methodInfoDeclaration);
+        public abstract void DefineMethodOverride(System.Reflection.MethodInfo methodInfoBody, System.Reflection.MethodInfo methodInfoDeclaration);
-        public System.Reflection.Emit.TypeBuilder DefineNestedType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Reflection.Emit.PackingSize packSize, int typeSize);
+        public abstract System.Reflection.Emit.TypeBuilder DefineNestedType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Reflection.Emit.PackingSize packSize, int typeSize);
-        public System.Reflection.Emit.TypeBuilder DefineNestedType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Type[]? interfaces);
+        public abstract System.Reflection.Emit.TypeBuilder DefineNestedType(string name, System.Reflection.TypeAttributes attr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent, System.Type[]? interfaces);
-        public System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);
+        public abstract System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);
-        public System.Reflection.Emit.PropertyBuilder DefineProperty(string name, System.Reflection.PropertyAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers);
+        public abstract System.Reflection.Emit.PropertyBuilder DefineProperty(string name, System.Reflection.PropertyAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[]? returnTypeRequiredCustomModifiers, System.Type[]? returnTypeOptionalCustomModifiers, System.Type[]? parameterTypes, System.Type[][]? parameterTypeRequiredCustomModifiers, System.Type[][]? parameterTypeOptionalCustomModifiers);
-        public System.Reflection.Emit.ConstructorBuilder DefineTypeInitializer();
+        public abstract System.Reflection.Emit.ConstructorBuilder DefineTypeInitializer();
-        public System.Reflection.Emit.FieldBuilder DefineUninitializedData(string name, int size, System.Reflection.FieldAttributes attributes);
+        public abstract System.Reflection.Emit.FieldBuilder DefineUninitializedData(string name, int size, System.Reflection.FieldAttributes attributes);
-        public bool IsCreated();
+        public abstract bool IsCreated();
-        public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
+        public abstract void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
-        public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
+        public abstract void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
-        public void SetParent([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent);
+        public abstract void SetParent([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type? parent);
    }
}

CC @jkotas @steveharter @AaronRobinsonMSFT @terrajobst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions