2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / errors / cs0278.cs
blob261223fc2ed3417250de17efa29f5e56bbe8aa3e
1 // CS0278: `Testing.IMixedEnumerable' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `Testing.ICustomEnumerable.GetEnumerator()'
2 // Line: 28
3 // Compiler options: -warnaserror -warn:2
5 using System;
6 using System.Collections;
8 namespace Testing {
9 interface ICustomEnumerable {
10 IEnumerator GetEnumerator();
13 interface IMixedEnumerable : IEnumerable, ICustomEnumerable {}
15 class TestCollection : IMixedEnumerable {
16 IEnumerator IEnumerable.GetEnumerator() {
17 return null;
20 IEnumerator ICustomEnumerable.GetEnumerator() {
21 return null;
25 class Test {
26 public static void Main(string[] args) {
27 IMixedEnumerable c = new TestCollection();
28 foreach(object o in c) {}