blob: aaa809f8bc4b153bed2ab7a5640c617d227189f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
//
// Tests the lookup of names on nested classes.
//
// Tests nested interfaces
//
class Top {
class X {
}
class Y : X {
}
interface A {
int get_one ();
}
interface B : A {
int get_two ();
}
public class XA : A {
public int get_one () { return 1; }
}
class XB : B {
public int get_one () { return 1; }
public int get_two () { return 2; }
}
static int Main ()
{
XA x = new XA ();
if (x.get_one () != 1)
return 1;
XB b = new XB ();
if (x.get_one () != 1)
return 2;
if (b.get_two () != 2)
return 3;
XB [] xb = null;
return 0;
}
}
//
// The following tests that the compiler will actually properly
// find the types that are requested (they are nested types)
//
class Other {
public void X ()
{
Top.XA xa = null;
Top.XA [] xb = null;
}
}
|