GenericParameter.cs: override Module properly
[mcs.git] / tests / gtest-243.cs
blob8eb70f40d8751081eb0689bd55055f3d02b77fae
1 // Bugs #77466 and #77460.
2 using System;
3 using System.Reflection;
4 using System.Collections.Generic;
6 public class Foo<T>
8 public void Test (T t)
9 { }
12 public class Tests
14 public static void foo<T> ()
18 public static int Test ()
20 MethodInfo mi = typeof (Tests).GetMethod ("foo");
21 if (!mi.IsGenericMethod)
22 return 1;
23 if (!mi.IsGenericMethodDefinition)
24 return 2;
25 MethodInfo mi2 = mi.MakeGenericMethod (new Type[] { typeof (int) });
26 if (!mi2.IsGenericMethod)
27 return 3;
28 if (mi2.IsGenericMethodDefinition)
29 return 4;
31 MethodInfo mi3 = typeof (Foo<int>).GetMethod ("Test");
32 if (mi3.IsGenericMethod)
33 return 5;
34 if (mi3.IsGenericMethodDefinition)
35 return 6;
37 return 0;
40 public static int Main ()
42 int result = Test ();
43 #if DEBUG
44 if (result == 0)
45 Console.WriteLine ("OK");
46 else
47 Console.WriteLine ("ERROR: {0}", result);
48 #endif
49 return result;