Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0057

Inconsistent accessibility: parameter type 'type' is less accessible than operator 'operator'

A public construct must return a publicly accessible object.

The following sample generates CS0057:

// CS0057.cs
class MyClass
// try the following line instead
// public class MyClass
{
}

public class MyClass2
{
   public static implicit operator MyClass2(MyClass iii)   // CS0057
   {
      return new MyClass2();
   }

   public static void Main()
   {
   }
}
Show:
© 2014 Microsoft