2002-06-17 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / tests / test-87.cs
1 //
2 // Tests the lookup of names on nested classes.
3 //
4 // Tests nested interfaces
5 //
6 class Top {
7
8         class X {
9
10         }
11
12         class Y : X {
13         }
14
15         interface A {
16                 int get_one ();
17         }
18
19         interface B : A {
20                 int get_two ();
21         }
22
23         class XA : A {
24                 public int get_one () { return 1; }
25         }
26
27         class XB : B {
28                 public int get_one () { return 1; }
29                 public int get_two () { return 2; }
30         }
31         
32         static int Main ()
33         {
34                 XA x = new XA ();
35
36                 if (x.get_one () != 1)
37                         return 1;
38
39                 XB b = new XB ();
40                 if (x.get_one () != 1)
41                         return 2;
42                 if (b.get_two () != 2)
43                         return 3;
44                 return 0;
45         }
46 }
47