summaryrefslogtreecommitdiff
path: root/mcs/tests/test-137.cs
blob: 277a92944f177ccd157154c64e63633006d53c11 (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++;
	}

	public 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;
	}
}