[ilasm] Don't break arguments compatiblity
[mono-project.git] / mcs / tests / dtest-046.cs
blob55eba0dbc15970ec60c277cc646147e7abd0abc4
1 using System;
3 class Test
5 delegate int D (ref int i);
7 public dynamic Foo;
9 public static int Main ()
11 dynamic d = new Test ();
13 d.Foo = (Func<int, int>) (l => 4 + l);
15 var r1 = d.Foo (3);
16 if (r1 != 7)
17 return 1;
19 d.Foo (2);
21 d.Foo = (Action) (() => Console.WriteLine ("action"));
22 d.Foo ();
24 d.Foo = (D) ((ref int l) => { l = 9; return 4; });
26 int ref_value = 3;
27 var r2 = d.Foo (ref ref_value);
28 if (r2 != 4)
29 return 2;
31 if (ref_value != 9)
32 return 3;
34 Console.WriteLine ("ok");
35 return 0;