2008-01-17 Rodrigo Kumpera <rkumpera@novell.com>
[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 Driver
42 {
43         public static int Main ()
44         {
45                 new GenericClass<int>().SimpleMethod ();
46                 new SimpleClass().GenericMethod<int>();
47                 new SimpleClass().GenericMethod<int>(10);
48
49                 return 0;
50         }
51 }