Merge branch 'master' of https://github.com/mono/mono into issue4328
[mono.git] / mcs / tests / test-anon-163.cs
1 using System;
2
3 class A
4 {
5         public virtual void Foo<T> (T a, params string[] b) where T : struct
6         {
7         }
8
9         protected virtual void Foo2<T> ()
10         {
11         }
12 }
13
14 class B : A
15 {
16         public void Test (int v)
17         {
18                 Action a = () => base.Foo<int> (b: "n", a: v);
19                 a ();
20         }
21
22         public void Test2<T> (T b) where T : struct
23         {
24                 Action a2 = () => base.Foo<T> (b, "as", "asdfa");
25         }
26
27         internal void Test3 ()
28         {
29                 int i = 0;
30                 Action a = delegate () {
31                         i = 1;
32                         base.Foo2<string> ();
33                 };
34
35                 a ();
36
37                 a = delegate () {
38                         i = 2;
39                         base.Foo2<int> ();
40                 };
41
42                 a ();
43         }
44 }
45
46 class Test
47 {
48         public static void Main ()
49         {
50                 var b = new B ();
51                 b.Test (1);
52                 b.Test2 (2);
53                 b.Test3 ();
54         }
55 }