2007-12-06 Jb Evain <jbevain@novell.com>
[mono.git] / mono / tests / virtual-method.cs
blob5a732c416f9498b047b346c2d8cee2da61cea84b
1 using System;
3 namespace Obj {
4 interface Bah {
5 int H ();
7 class A : Bah {
8 public int F () {return 1;}
9 public virtual int G () {return 2;}
10 public int H () {return 10;}
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;}
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;