Skip to content

Commit

Permalink
resolved Ourpalm#250
Browse files Browse the repository at this point in the history
  • Loading branch information
ymh199478 authored and liiir1985 committed Jan 8, 2019
1 parent 082b46e commit 094d38b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion ILRuntime/Reflection/ILRuntimeConstructorInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 2 additions & 1 deletion ILRuntime/Reflection/ILRuntimeMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
13 changes: 4 additions & 9 deletions ILRuntime/Reflection/ILRuntimeParameterInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -27,13 +30,5 @@ public override Type ParameterType
return type.ReflectionType;
}
}

public override string Name
{
get
{
return type.FullName;
}
}
}
}

0 comments on commit 094d38b

Please sign in to comment.