[Mono.Profiler.Log] Support MLPD version 13
[mono.git] / mcs / tests / dtest-054.cs
1 using System;
2
3 // dynamic with anonymous method mutator
4
5 class C
6 {
7         static Action<T> Test<T> (T t)
8         {
9                 return l => {
10                         dynamic d = l;
11                         d.Method (l);
12                 };
13         }
14
15         static Action Test2<T> (T t)
16         {
17                 T l = t;
18                 return () => {
19                         T l2 = l;
20                         Action a = () => {
21                                 dynamic d = l2;
22                                 d.Method (l);
23                         };
24
25                         a ();
26                 };
27         }
28
29         static Action<T> Test3<T> (T t)
30         {
31                 return l => {
32                         dynamic d = l;
33                         d.MethodRef (ref l);
34                 };
35         }
36
37         static Action Test4<T> (T t)
38         {
39                 T l = t;
40                 return () => {
41                         dynamic d = l;
42                         d.MethodRef (ref l);
43                 };
44         }
45
46         void Method (object arg)
47         {
48         }
49
50         void MethodRef (ref C arg)
51         {
52                 arg = new C ();
53         }
54
55         public static int Main ()
56         {
57                 Test<C> (null) (new C ());
58                 Test2 (new C ()) ();
59                 Test<C> (null) (new C ());
60                 Test4 (new C ()) ();
61
62                 return 0;
63         }
64 }