Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #996 from terrajobst/reflection-sync
Browse files Browse the repository at this point in the history
List excluded reflection emit APIs
  • Loading branch information
terrajobst committed Dec 6, 2018
2 parents e01d397 + 61718d1 commit 689aaa9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 5 deletions.
46 changes: 46 additions & 0 deletions netstandard/ref/System.Reflection.Emit.cs
Expand Up @@ -13,12 +13,19 @@ public sealed partial class AssemblyBuilder : System.Reflection.Assembly
public static System.Reflection.Emit.AssemblyBuilder DefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access) { throw null; }
public static System.Reflection.Emit.AssemblyBuilder DefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access, System.Collections.Generic.IEnumerable<System.Reflection.Emit.CustomAttributeBuilder> assemblyAttributes) { throw null; }
public System.Reflection.Emit.ModuleBuilder DefineDynamicModule(string name) { throw null; }
// Excluded because persistence of Ref Emit is only supported in .NET Framework
// public System.Reflection.Emit.ModuleBuilder DefineDynamicModule(string name, bool emitSymbolInfo) { throw null; }
// public System.Reflection.Emit.ModuleBuilder DefineDynamicModule(string name, string fileName) { throw null; }
// public System.Reflection.Emit.ModuleBuilder DefineDynamicModule(string name, string fileName, bool emitSymbolInfo) { throw null; }
public override bool Equals(object obj) { throw null; }
public System.Reflection.Emit.ModuleBuilder GetDynamicModule(string name) { throw null; }
public override int GetHashCode() { throw null; }
public override System.Reflection.ManifestResourceInfo GetManifestResourceInfo(string resourceName) { throw null; }
public override string[] GetManifestResourceNames() { throw null; }
public override System.IO.Stream GetManifestResourceStream(string name) { throw null; }
// Excluded because persistence of Ref Emit is only supported in .NET Framework
// public void Save(string assemblyFileName) { }
// public void Save(string assemblyFileName, System.Reflection.PortableExecutableKinds portableExecutableKind, System.Reflection.ImageFileMachine imageFileMachine) { }
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute) { }
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) { }
}
Expand All @@ -27,6 +34,9 @@ public enum AssemblyBuilderAccess
{
Run = 1,
RunAndCollect = 9,
// Excluded because persistence of Ref Emit is only supported in .NET Framework
// RunAndSave = 3,
// Save = 2,
}
public sealed partial class ConstructorBuilder : System.Reflection.ConstructorInfo
{
Expand All @@ -39,6 +49,9 @@ public sealed partial class ConstructorBuilder : System.Reflection.ConstructorIn
public override System.Reflection.Module Module { get { throw null; } }
public override string Name { get { throw null; } }
public override System.Type ReflectedType { get { throw null; } }
// [System.ObsoleteAttribute("This property has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
// public System.Type ReturnType { get { throw null; } }
//CAS public void AddDeclarativeSecurity(System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset) { }
public System.Reflection.Emit.ParameterBuilder DefineParameter(int iSequence, System.Reflection.ParameterAttributes attributes, string strParamName) { throw null; }
public override object[] GetCustomAttributes(bool inherit) { throw null; }
public override object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
Expand All @@ -52,6 +65,8 @@ public sealed partial class ConstructorBuilder : System.Reflection.ConstructorIn
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute) { }
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) { }
public void SetImplementationFlags(System.Reflection.MethodImplAttributes attributes) { }
// Excluded because we don't support generating with debug information.
// public void SetSymCustomAttribute(string name, byte[] data) { }
public override string ToString() { throw null; }
}
public partial class CustomAttributeBuilder
Expand Down Expand Up @@ -182,6 +197,8 @@ public sealed partial class FieldBuilder : System.Reflection.FieldInfo
public void SetConstant(object defaultValue) { }
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute) { }
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) { }
// [System.ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
// public void SetMarshal(System.Reflection.Emit.UnmanagedMarshal unmanagedMarshal) { }
public void SetOffset(int iOffset) { }
public override void SetValue(object obj, object val, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) { }
}
Expand Down Expand Up @@ -331,6 +348,9 @@ public sealed partial class LocalBuilder : System.Reflection.LocalVariableInfo
public override bool IsPinned { get { throw null; } }
public override int LocalIndex { get { throw null; } }
public override System.Type LocalType { get { throw null; } }
// Excluded because we don't support generating with debug information.
// public void SetLocalSymInfo(string name) { }
// public void SetLocalSymInfo(string name, int startOffset, int endOffset) { }
}
public sealed partial class MethodBuilder : System.Reflection.MethodInfo
{
Expand All @@ -350,6 +370,7 @@ public sealed partial class MethodBuilder : System.Reflection.MethodInfo
public override System.Reflection.ParameterInfo ReturnParameter { get { throw null; } }
public override System.Type ReturnType { get { throw null; } }
public override System.Reflection.ICustomAttributeProvider ReturnTypeCustomAttributes { get { throw null; } }
//CAS public void AddDeclarativeSecurity(System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset) { }
public System.Reflection.Emit.GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names) { throw null; }
public System.Reflection.Emit.ParameterBuilder DefineParameter(int position, System.Reflection.ParameterAttributes attributes, string strParamName) { throw null; }
public override bool Equals(object obj) { throw null; }
Expand All @@ -369,9 +390,13 @@ public sealed partial class MethodBuilder : System.Reflection.MethodInfo
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute) { }
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) { }
public void SetImplementationFlags(System.Reflection.MethodImplAttributes attributes) { }
// [System.ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
// public void SetMarshal(System.Reflection.Emit.UnmanagedMarshal unmanagedMarshal) { }
public void SetParameters(params System.Type[] parameterTypes) { }
public 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) { }
// Excluded because we don't support generating with debug information.
// public void SetSymCustomAttribute(string name, byte[] data) { }
public override string ToString() { throw null; }
}
public partial class ModuleBuilder : System.Reflection.Module
Expand All @@ -381,6 +406,8 @@ public partial class ModuleBuilder : System.Reflection.Module
public override string FullyQualifiedName { get { throw null; } }
public override string Name { get { throw null; } }
public void CreateGlobalFunctions() { }
// Excluded because we don't support generating with debug information.
// public System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument(string url, System.Guid language, System.Guid languageVendor, System.Guid documentType) { throw null; }
public System.Reflection.Emit.EnumBuilder DefineEnum(string name, System.Reflection.TypeAttributes visibility, System.Type underlyingType) { throw null; }
public System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes) { throw null; }
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) { throw null; }
Expand All @@ -399,6 +426,8 @@ public partial class ModuleBuilder : System.Reflection.Module
public override int GetHashCode() { throw null; }
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute) { }
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) { }
// Excluded because we don't support generating with debug information.
// public void SetSymCustomAttribute(string name, byte[] data) { }
}
public partial struct OpCode
{
Expand Down Expand Up @@ -704,6 +733,8 @@ public partial class ParameterBuilder
public virtual void SetConstant(object defaultValue) { }
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute) { }
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) { }
// [System.ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
// public virtual void SetMarshal(System.Reflection.Emit.UnmanagedMarshal unmanagedMarshal) { }
}
public sealed partial class PropertyBuilder : System.Reflection.PropertyInfo
{
Expand Down Expand Up @@ -820,6 +851,7 @@ public sealed partial class TypeBuilder : System.Type
public int Size { get { throw null; } }
public override System.RuntimeTypeHandle TypeHandle { get { throw null; } }
public override System.Type UnderlyingSystemType { get { throw null; } }
//CAS public void AddDeclarativeSecurity(System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset) { }
public void AddInterfaceImplementation(System.Type interfaceType) { }
public System.Type CreateType() { throw null; }
public System.Reflection.TypeInfo CreateTypeInfo() { throw null; }
Expand Down Expand Up @@ -898,4 +930,18 @@ public sealed partial class TypeBuilder : System.Type
public void SetParent(System.Type parent) { }
public override string ToString() { throw null; }
}
// [System.ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
// public sealed partial class UnmanagedMarshal
// {
// internal UnmanagedMarshal() { }
// public System.Runtime.InteropServices.UnmanagedType BaseType { get { throw null; } }
// public int ElementCount { get { throw null; } }
// public System.Runtime.InteropServices.UnmanagedType GetUnmanagedType { get { throw null; } }
// public System.Guid IIDGuid { get { throw null; } }
// public static System.Reflection.Emit.UnmanagedMarshal DefineByValArray(int elemCount) { throw null; }
// public static System.Reflection.Emit.UnmanagedMarshal DefineByValTStr(int elemCount) { throw null; }
// public static System.Reflection.Emit.UnmanagedMarshal DefineLPArray(System.Runtime.InteropServices.UnmanagedType elemType) { throw null; }
// public static System.Reflection.Emit.UnmanagedMarshal DefineSafeArray(System.Runtime.InteropServices.UnmanagedType elemType) { throw null; }
// public static System.Reflection.Emit.UnmanagedMarshal DefineUnmanagedMarshal(System.Runtime.InteropServices.UnmanagedType unmanagedType) { throw null; }
// }
}
17 changes: 12 additions & 5 deletions netstandard/ref/System.Reflection.cs
Expand Up @@ -400,8 +400,8 @@ public partial class CustomAttributeFormatException : System.FormatException
}
public partial struct CustomAttributeNamedArgument
{
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, object value) { throw null;}
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, System.Reflection.CustomAttributeTypedArgument typedArgument) { throw null;}
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, object value) { throw null; }
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, System.Reflection.CustomAttributeTypedArgument typedArgument) { throw null; }
public bool IsField { get { throw null; } }
public System.Reflection.MemberInfo MemberInfo { get { throw null; } }
public string MemberName { get { throw null; } }
Expand All @@ -414,8 +414,8 @@ public partial struct CustomAttributeNamedArgument
}
public partial struct CustomAttributeTypedArgument
{
public CustomAttributeTypedArgument(object value) { throw null;}
public CustomAttributeTypedArgument(System.Type argumentType, object value) { throw null;}
public CustomAttributeTypedArgument(object value) { throw null; }
public CustomAttributeTypedArgument(System.Type argumentType, object value) { throw null; }
public System.Type ArgumentType { get { throw null; } }
public object Value { get { throw null; } }
public override bool Equals(object obj) { throw null; }
Expand Down Expand Up @@ -817,6 +817,13 @@ public abstract partial class Module : System.Reflection.ICustomAttributeProvide
public virtual System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingFlags) { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public virtual void GetPEKind(out System.Reflection.PortableExecutableKinds peKind, out System.Reflection.ImageFileMachine machine) { peKind = default(System.Reflection.PortableExecutableKinds); machine = default(System.Reflection.ImageFileMachine); }
// We've excluded GetSignerCertificate() for the following reasons:
// * It pulls in crypto, which isn't in corlib in .NET Core
// * It's unclear how this API would work if the module has multiple certs
// * It seems like a fringe scenario. If there are use cases for extracting Authenticode signatures from modules,
// it should probably be part of System.Reflection.Metadata and return raw blobs. The consumer can feed it to
// crypto cert AIs (e.g. as a byte array), which would avaoid the layering issue.
// public virtual System.Security.Cryptography.X509Certificates.X509Certificate GetSignerCertificate() { throw null; }
public virtual System.Type GetType(string className) { throw null; }
public virtual System.Type GetType(string className, bool ignoreCase) { throw null; }
public virtual System.Type GetType(string className, bool throwOnError, bool ignoreCase) { throw null; }
Expand Down Expand Up @@ -904,7 +911,7 @@ public partial class ParameterInfo : System.Reflection.ICustomAttributeProvider,
}
public readonly partial struct ParameterModifier
{
public ParameterModifier(int parameterCount) { throw null;}
public ParameterModifier(int parameterCount) { throw null; }
public bool this[int index] { get { throw null; } set { } }
}
[System.CLSCompliantAttribute(false)]
Expand Down

0 comments on commit 689aaa9

Please sign in to comment.