Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-87.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa476b400a209e7c359764cb7f41628eb6e929cc (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; }
	}
	
	public 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;
	}
}