Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / virtual-method.cs
1 using System;
2
3 namespace Obj {
4         interface Bah {
5                 int H ();
6         }
7         class A : Bah {
8                 public int F () {return 1;}
9                 public virtual int G () {return 2;}
10                 public int H () {return 10;}
11         }
12         class B : A {
13                 public new int F () {return 3;}
14                 public override int G () {return 4;}
15                 public new int H () {return 11;}
16         }
17         class Test {
18                 static public int Main () {
19                         int result = 0;
20                         B b = new B ();
21                         A a = b;
22                         if (a.F () != 1)
23                                 result |= 1 << 0;
24                         if (b.F () != 3)
25                                 result |= 1 << 1;
26                         if (b.G () != 4)
27                                 result |= 1 << 2;
28                         if (a.G () != 4)
29                                 result |= 1 << 3;
30                         if (a.H () != 10)
31                                 result |= 1 << 4;
32                         if (b.H () != 11)
33                                 result |= 1 << 5;
34                         if (((A)b).H () != 10)
35                                 result |= 1 << 6;
36                         if (((B)a).H () != 11)
37                                 result |= 1 << 7;
38                         return result;
39                 }
40         };
41 };