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

cs0229.cs « errors « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e69c449ac9b238765cf67ef9d8261b2fa345c02a (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
// cs0229.cs: Ambiguity between `IList.Count' and `ICounter.Count (int)'
// Line: 30
using System;

interface IList {
	int Count { get; set; }
}

interface ICounter {
	void Count (int i);
}

interface IListCounter: IList, ICounter {}


class ListCounter : IListCounter {
	int IList.Count {
		get { Console.WriteLine ("int IList.Count.get"); return 1; }
		set { Console.WriteLine ("int IList.Count.set"); }
	}
	
	void ICounter.Count (int i)
	{
		Console.WriteLine ("int ICounter.Count (int i)");
	}
	
	static void Main ()
	{
		IListCounter t = new ListCounter ();
		t.Count (1); 
	}
}