Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ILRuntime/CLR/Method/ILMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public List<IType> Parameters
{
get
{
if (def.HasParameters && parameters == null)
if (def.HasParameters || parameters == null)
{
InitParameters();
}
Expand Down
5 changes: 4 additions & 1 deletion ILRuntime/Reflection/ILRuntimeMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,14 @@ public override object[] GetCustomAttributes(Type attributeType, bool inherit)
List<object> res = new List<object>();
for (int i = 0; i < customAttributes.Length; i++)
{
if (attributeTypes[i].Equals(attributeType))
if (attributeTypes[i].Equals(attributeType)||attributeType.IsAssignableFrom ( attributeTypes[i] ))
res.Add(customAttributes[i]);
}
return res.ToArray();
}
public Object GetCustomAttribute ( Type oType, Boolean inherit ) => this.GetCustomAttributes ( oType, inherit ).FirstOrDefault ();
public T GetCustomAttribute<T> ( Boolean inherit ) where T : System.Attribute => this.GetCustomAttributes<T> ( inherit ).FirstOrDefault ();
public T [] GetCustomAttributes<T> ( Boolean inherit ) where T : System.Attribute => this.GetCustomAttributes ( typeof ( T ), inherit ).Select ( t => ( T ) t ).ToArray ();

public override MethodImplAttributes GetMethodImplementationFlags()
{
Expand Down
2 changes: 1 addition & 1 deletion ILRuntime/Runtime/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public static bool MatchGenericParameters(this Type[] args, Type type, Type q, T
if (q.IsGenericType)
{
var t1 = type.GetGenericTypeDefinition();
var t2 = type.GetGenericTypeDefinition();
var t2 = q.GetGenericTypeDefinition();
if (t1 == t2)
{
var argA = type.GetGenericArguments();
Expand Down