Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
User-defined operator 'operator' must be declared static and public
Both the static and public access modifiers must be specified on user-defined operators.
The following sample generates CS0558:
// CS0558.cs
namespace x
{
   public class ii
   {
      public class iii
      {
         static implicit operator int(iii aa)   // CS0558, add public
         {
            return 0;
         }
      }
      public static void Main()
      {
      }
   }
}