2010-05-27 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / errors / cs0278.cs
1 // CS0278: `Testing.IMixedEnumerable' contains ambiguous implementation of `enumerable' pattern. Method `Testing.ICustomEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.IEnumerable.GetEnumerator()'\r
2 // Line: 28\r
3 // Compiler options: -warnaserror -warn:2\r
4 \r
5 using System;\r
6 using System.Collections;\r
7 \r
8 namespace Testing {\r
9         interface ICustomEnumerable {\r
10                 IEnumerator GetEnumerator();\r
11         }\r
12 \r
13         interface IMixedEnumerable : IEnumerable, ICustomEnumerable {}\r
14 \r
15         class TestCollection : IMixedEnumerable {\r
16                 IEnumerator IEnumerable.GetEnumerator() {\r
17                         return null;\r
18                 }\r
19 \r
20                 IEnumerator ICustomEnumerable.GetEnumerator()  {\r
21                         return null;\r
22                 }\r
23         }\r
24 \r
25         class Test {\r
26                 public static void Main(string[] args) {\r
27                         IMixedEnumerable c = new TestCollection();\r
28                         foreach(object o in c) {}\r
29                 }\r
30         }\r
31 }