Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

35 lines
625 B
C#

using System;
using System.Reflection;
namespace FLMID.Bugs.ParametersOne
{
public class Class<T>
{
public void Add(T x)
{
System.Console.WriteLine("OK");
}
}
public class Test
{
public static void Main(string [] args)
{
Class<string> instance = new Class<string>();
MethodInfo _method = null;
foreach(MethodInfo method in
typeof(Class<string>).GetMethods(BindingFlags.Instance | BindingFlags.Public))
{
if(method.Name.Equals("Add") && method.GetParameters().Length==1)
{
_method = method;
break;
}
}
_method.Invoke(instance , new object[]{"1"});
}
}
}