- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Reflection
Milestone
Description
With Abstract System.Reflection.Emit public types we have abstracted other System.Reflection.Emit.XyzBuilder types, ParameterBuilder type left out from this effort (probably because it lives in different ref file).
The type also needs to be abstracted same as others because:
- Because of internal constructor could not create an instance of it outside of CoreLib. (The new AsemblyBuilderimplementation will be added outside of CoreLib)
- Even if we workaround the internal constructor we could not get CustomAttributesinfo set to theParameterBuilderinstance, same for the default value.
Suggested API change:
namespace System.Reflection.Emit
{
-   public class ParameterBuilder
+   public abstract class ParameterBuilder
    {
-       internal ParameterBuilder() { }
+       protected ParameterBuilder() { }
        public virtual int Attributes { get { throw null; } }
        public bool IsIn { get { throw null; } }
        public bool IsOptional { get { throw null; } }
        public bool IsOut { get { throw null; } }
        public virtual string? Name { get { throw null; } }
        public virtual int Position { get { throw null; } }
        public virtual void SetConstant(object? defaultValue) { }
        public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) { }
+       protected abstract void SetCustomAttributeCore(ConstructorInfo con, byte[] binaryAttribute);
        public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { }
    }
}Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Reflection