2 using System.Reflection;
12 public static void Func (U u)
14 Console.WriteLine (u);
20 static void Test (Type t, object arg)
22 MethodInfo mi = t.GetMethod ("Func");
23 mi.Invoke (null, new object[] { arg });
28 Test (typeof (Test<Foo<int>>), new Foo<int> ());
29 Test (typeof (Test<Bar<int>>), new Bar<int> ());
30 Test (typeof (Test<Bar<string>>), new Bar<string> ());
31 Test (typeof (Test<Foo<DateTime>>), new Foo<DateTime> ());
32 Test (typeof (Test<DateTime>), DateTime.Now);
33 Test (typeof (Test<string>), "Hello");