1 // CS0278: `Testing.IMixedEnumerable' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `Testing.ICustomEnumerable.GetEnumerator()'
3 // Compiler options: -warnaserror -warn:2
6 using System
.Collections
;
9 interface ICustomEnumerable
{
10 IEnumerator
GetEnumerator();
13 interface IMixedEnumerable
: IEnumerable
, ICustomEnumerable
{}
15 class TestCollection
: IMixedEnumerable
{
16 IEnumerator IEnumerable
.GetEnumerator() {
20 IEnumerator ICustomEnumerable
.GetEnumerator() {
26 public static void Main(string[] args
) {
27 IMixedEnumerable c
= new TestCollection();
28 foreach(object o
in c
) {}