Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / dtest-054.cs
blob90f440dff211eb4a78dd3805b876a5cb68077e7f
1 using System;
3 // dynamic with anonymous method mutator
5 class C
7 static Action<T> Test<T> (T t)
9 return l => {
10 dynamic d = l;
11 d.Method (l);
15 static Action Test2<T> (T t)
17 T l = t;
18 return () => {
19 T l2 = l;
20 Action a = () => {
21 dynamic d = l2;
22 d.Method (l);
25 a ();
29 static Action<T> Test3<T> (T t)
31 return l => {
32 dynamic d = l;
33 d.MethodRef (ref l);
37 static Action Test4<T> (T t)
39 T l = t;
40 return () => {
41 dynamic d = l;
42 d.MethodRef (ref l);
46 void Method (object arg)
50 void MethodRef (ref C arg)
52 arg = new C ();
55 public static int Main ()
57 Test<C> (null) (new C ());
58 Test2 (new C ()) ();
59 Test<C> (null) (new C ());
60 Test4 (new C ()) ();
62 return 0;