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

test-70.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0173918824582d8cbd118ac6128ec02ba40ad125 (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
//
// Tests the right settings for overrides
//

class X {

	public virtual int A {
		get {
			return 1;
		}
	}

	public virtual int B ()
	{
		return 1;
	}
}

class Y : X {
	public override int A {
		get {
			return base.A + 2;
		}
	}

	public override int B ()
	{
		return base.B () + 1;
	}
}

class Z {
	public static int Main ()
	{
		Y y = new Y ();
		X x = new X ();
				       
		if (y.B () != 2)
			return 1;
		if (y.A != 3)
			return 2;
		if (x.A != 1)
			return 3;
		if (x.B () != 1)
			return 4;
		return 0;
	}
}