diff --git a/ILRuntime/Reflection/ILRuntimeConstructorInfo.cs b/ILRuntime/Reflection/ILRuntimeConstructorInfo.cs index 354a7853..07037139 100644 --- a/ILRuntime/Reflection/ILRuntimeConstructorInfo.cs +++ b/ILRuntime/Reflection/ILRuntimeConstructorInfo.cs @@ -20,7 +20,8 @@ public ILRuntimeConstructorInfo(ILMethod m) parameters = new ILRuntimeParameterInfo[m.ParameterCount]; for(int i = 0; i < m.ParameterCount; i++) { - parameters[i] = new ILRuntimeParameterInfo(m.Parameters[i], this); + var pd = m.Definition.Parameters[i]; + parameters[i] = new ILRuntimeParameterInfo(pd, m.Parameters[i], this); } } diff --git a/ILRuntime/Reflection/ILRuntimeMethodInfo.cs b/ILRuntime/Reflection/ILRuntimeMethodInfo.cs index b5528abf..ed717cd0 100644 --- a/ILRuntime/Reflection/ILRuntimeMethodInfo.cs +++ b/ILRuntime/Reflection/ILRuntimeMethodInfo.cs @@ -27,7 +27,8 @@ public ILRuntimeMethodInfo(ILMethod m) parameters = new ILRuntimeParameterInfo[m.ParameterCount]; for (int i = 0; i < m.ParameterCount; i++) { - parameters[i] = new ILRuntimeParameterInfo(m.Parameters[i], this); + var pd = m.Definition.Parameters[i]; + parameters[i] = new ILRuntimeParameterInfo(pd, m.Parameters[i], this); } } diff --git a/ILRuntime/Reflection/ILRuntimeParameterInfo.cs b/ILRuntime/Reflection/ILRuntimeParameterInfo.cs index 64a33c7d..ce6ba709 100644 --- a/ILRuntime/Reflection/ILRuntimeParameterInfo.cs +++ b/ILRuntime/Reflection/ILRuntimeParameterInfo.cs @@ -13,12 +13,15 @@ public class ILRuntimeParameterInfo : ParameterInfo { IType type; MethodBase method; + Mono.Cecil.ParameterDefinition definition; - public ILRuntimeParameterInfo(IType type, MethodBase method) + public ILRuntimeParameterInfo(Mono.Cecil.ParameterDefinition definition, IType type, MethodBase method) { this.type = type; this.method = method; this.MemberImpl = method; + this.definition = definition; + NameImpl = definition.Name; } public override Type ParameterType { @@ -27,13 +30,5 @@ public override Type ParameterType return type.ReflectionType; } } - - public override string Name - { - get - { - return type.FullName; - } - } } }