This documentation is archived and is not being maintained.

Compiler Error CS0030 

Error Message

Cannot convert type 'type' to 'type'

You must provide conversion routines to support certain operator overloads. For more information, see Conversion Operators (C# Programming Guide).

The following sample generates CS0030:

// CS0030.cs
namespace x
{
   public class iii
   {
      /*
      public static implicit operator iii(int aa)
      {
         return null;
      }

      public static implicit operator int(iii aa)
      {
         return 0;
      }
      */

      public static iii operator ++(iii aa)
      {
         return (iii)0;   // CS0030
         // uncomment the conversion routines to resolve CS0030
      }

      public static void Main()
      {
      }
   }
}
Show: