[Mono-list] CS0278 "ambiguous implementation of `enumerable' pattern"

Felipe Almeida Lessa felipe.lessa at gmail.com
Thu Jan 18 13:14:46 EST 2007


On 1/18/07, Chris Seaton <chris at chrisseaton.com> wrote:
> Katahdin.Debugger/RuntimeThread.cs(65,21): warning CS0278:
> `System.Collections.Generic.IList<string>' contains
> ambiguous implementation of `enumerable' pattern. Method
> `System.Collections.IEnumerable.GetEnumerator()' is
> ambiguous with method
> `System.Collections.Generic.IEnumerable<string>.GetEnumerator()'

The problem is that the compiler don't know if it uses IEnumerable ou
IEnumerable<T>, both which are implemented by IList<T>. You can solve
this by writing an explicit cast:

                    foreach (string file in (IEnumerator<string>)files)
                        runtime.Import(file);

-- 
Felipe.


More information about the Mono-list mailing list