[sre] register a canonical MonoReflectionMethod for a methodref token
[mono.git] / mono / tests / verifier / valid_generic_params.cs
1 public class GenericClass<T>
2 {
3         public void SimpleMethod ()
4         {
5                 T a = default (T);
6                 T b = a;
7                 T c;
8                 if (SimpleClass.cond)
9                         c = a;
10                 else
11                         c = b;          
12         }
13
14         public void SimpleMethod2 (ref T a)
15         {
16                 T b = a;
17                 T c;
18                 if (SimpleClass.cond)
19                         c = a;
20                 else
21                         c = b;
22                 a = c;
23         }
24 }
25
26 public class SimpleClass
27 {
28         public static bool cond;
29         public void GenericMethod<T> () {
30                 T a = default (T);
31                 T b = a;
32         }
33
34         public void GenericMethod<T> (T t) {
35                 T a = t;
36                 t = a;
37         }
38
39 }
40
41 public class ComplexClass<K>
42 {
43         public static bool cond;
44         public void GenericMethod<T> (K k) {
45                 T a = default (T);
46                 T b = a;
47         }
48
49         public void GenericMethod<T> (K k, T t) {
50                 T a = t;
51                 t = a;
52         }
53
54 }
55
56
57 public class Driver
58 {
59         public static int Main ()
60         {
61                 new GenericClass<int>().SimpleMethod ();
62                 new SimpleClass().GenericMethod<int>();
63                 new SimpleClass().GenericMethod<int>(10);
64
65                 new ComplexClass<float>().GenericMethod<int>(1.1f);
66                 new ComplexClass<float>().GenericMethod<int>(2.2f, 10);
67
68                 return 0;
69         }
70 }