Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-205.cs
1 using System;
2 using System.Reflection;
3
4 public class Foo<S>
5 { }
6
7 public struct Bar<T>
8 { }
9
10 public class Test<U>
11 {
12         public static void Func (U u)
13         {
14                 Console.WriteLine (u);
15         }
16 }
17
18 class X
19 {
20         static void Test (Type t, object arg)
21         {
22                 MethodInfo mi = t.GetMethod ("Func");
23                 mi.Invoke (null, new object[] { arg });
24         }
25
26         public static void Main ()
27         {
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");
34         }
35 }