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)
{
}
}
}
|