Edit

Share via


Compiler Error CS0030

Cannot convert type 'type' to 'type'

There is no predefined conversion between types. You can define a custom conversion between those types. For more information, see User-defined conversion operators.

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()  
      {  
      }  
   }  
}