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

test-137.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ba11bb7fc393a4db8b24aeefbf07e76939829927 (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
//
// Explicitly implement all the interface methods pending with the same name.
//
using System;

interface A {
	void X ();
}

interface B {
	void X ();
}

class C : A, B {
	int var;
	
	public void X ()
	{
		var++;
	}

	static int Main ()
	{
		C c = new C ();

		A a = c;
		B b = c;

		if (c.var != 0)
			return 1;
		
		a.X ();
		if (c.var != 1)
			return 2;
		b.X ();
		if (c.var != 2)
			return 3;
		c.X ();
		if (c.var != 3)
			return 4;

		Console.WriteLine ("Test passes");
		return 0;
	}
}