Login | Sign Up
ErrorKey - Search engine for Error codes and messages       Comment an error
Return to search results
  Compiler Warning (level 2) CS0278  -  MICROSOFT
'type' does not implement the 'pattern name' pattern. 'method name' is ambiguous with 'method name'. There are several statements in C# that rely on defined patterns, such as foreach and using. For example, foreach relies on the collection class implementing the "enumerable" pattern. CS0278 can occur if the compiler is unable to make the match due to ambiguities. For example, the "enumerable" pattern requires that there be a method called MoveNext, and your code might contain two methods called MoveNext. The compiler will attempt to find an interface to use, but it is recommended that you determine and resolve the cause of the ambiguity. For more information, see How to: Access a Collection Class with foreach (C# Programming Guide). Example The following sample generates CS0278. // CS0278.cs using System.Collections.Generic; public class myTest { public static void TestForeach(W w) where W: IEnumerable, IEnumerable { foreach (int i in w) {} // CS0278 } }  Login to see more
C# .Net Compiler Errors and Warnings

You must login to post a comment.