Skip to content

Commit bb7ba5a

Browse files
committed
CLJCLR-167: Reflector.GetMethods should filter for generic methods with the appropriate number of type args
1 parent 76542bd commit bb7ba5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Clojure/Clojure/Runtime/Reflector.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,9 @@ internal static IList<MethodBase> GetMethods(Type targetType, string methodName,
204204
IEnumerable<MethodInfo> einfos
205205
= targetType.GetMethods(flags).Where(info => info.Name == methodName && info.GetParameters().Length == arity);
206206
infos = new List<MethodBase>();
207+
var numTypeArgs = typeArgs.Count;
207208
foreach (MethodInfo minfo in einfos)
208-
if (!typeArgs.IsEmpty && minfo.ContainsGenericParameters) // TODO: Fix this -- should have match in number of type args and generic parameters (CLJCLR-167)
209+
if (!typeArgs.IsEmpty && minfo.ContainsGenericParameters && minfo.GetGenericArguments().Length == numTypeArgs)
209210
infos.Add(minfo.MakeGenericMethod(typeArgs.ToArray()));
210211
else
211212
infos.Add(minfo);

0 commit comments

Comments
 (0)