summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0278-2.cs
blob: 7d58bd388b02420d013a7fa549935120996f696f (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
// CS0278: `IListCounter' contains ambiguous implementation of `enumerable' pattern. Method `IList.GetEnumerator()' is ambiguous with method `ICounter.GetEnumerator()'
// Line: 26
// Compiler options: -warnaserror -warn:2

using System;
using System.Collections;

interface IList 
{
	IEnumerator GetEnumerator ();
}

interface ICounter 
{
	IEnumerator GetEnumerator ();
}

interface IListCounter: IList, ICounter
{
}

class Test
{
	static void Foo (IListCounter t)
	{
		foreach (var e in t)
		{
		}
	}
}