Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / test-anon-139.cs
1 using System;
2
3 public class Test
4 {
5         delegate void D ();
6         
7         public static void Main ()
8         {
9                 Test t = new Test ();
10                 t.Test_1 (t);
11                 t.Test_2<int> (1);
12                 t.Test_3<Test> (1);
13         }
14
15         public void Test_1<T> (T t) where T : Test
16         {
17                 D d = delegate () {
18                         Action<T> d2 = new Action<T> (t.Test_1);
19                 };
20                 d ();
21         }
22         
23         public void Test_2<T> (T? t) where T : struct
24         {
25                 bool b;
26                 T t2;
27                 D d = delegate () {
28                         b = t == null;
29                         t2 = (T)t;
30                         t2 = t ?? default (T);
31                 };
32                 
33                 d ();
34         }
35         
36         public T Test_3<T> (object o) where T : class
37         {
38                 bool b;
39                 T t2 = null;
40                 D d = delegate () {
41                         t2 = o as T;
42                 };
43                 
44                 d ();
45                 return t2;
46         }
47 }