Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-164.cs
1 using System;
2
3 class X
4 {
5         protected virtual int Foo ()
6         {
7                 return 1;
8         }
9
10         protected delegate int FooDelegate ();
11         protected FooDelegate foo;
12
13         protected X ()
14         {
15                 foo = new FooDelegate (Foo);
16         }
17 }
18
19 class Y : X
20 {
21         protected Y ()
22                 : base ()
23         { }
24
25         protected override int Foo ()
26         {
27                 return 2;
28         }
29
30         int Hello ()
31         {
32                 return foo ();
33         }
34
35         public static void Main ()
36         {
37                 Y y = new Y ();
38                 int result = y.Hello ();
39
40                 if (result == 2)
41                         Console.WriteLine ("OK");
42                 else
43                         Console.WriteLine ("NOT OK");
44         }
45 }