Update dependencies from https://github.com/dotnet/arcade build 20190729.1 (#15881)
[mono-project.git] / mcs / tests / test-164.cs
blob9f08f01d10612eab98372fbcd343f12dcd934857
1 using System;
3 class X
5 protected virtual int Foo ()
7 return 1;
10 protected delegate int FooDelegate ();
11 protected FooDelegate foo;
13 protected X ()
15 foo = new FooDelegate (Foo);
19 class Y : X
21 protected Y ()
22 : base ()
23 { }
25 protected override int Foo ()
27 return 2;
30 int Hello ()
32 return foo ();
35 public static void Main ()
37 Y y = new Y ();
38 int result = y.Hello ();
40 if (result == 2)
41 Console.WriteLine ("OK");
42 else
43 Console.WriteLine ("NOT OK");