Skip to content

Latest commit

 

History

History
40 lines (35 loc) · 861 Bytes

cs0556.md

File metadata and controls

40 lines (35 loc) · 861 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Compiler Error CS0556
Compiler Error CS0556
07/20/2015
CS0556
CS0556
e2430c6e-784f-4ab2-88b9-f660d956e9e8

Compiler Error CS0556

User-defined conversion must convert to or from the enclosing type

A user-defined conversion routine must convert to or from the class that contains the routine.

The following sample generates CS0556:

// CS0556.cs  
namespace x  
{  
   public class ii  
   {  
      public class iii  
      {  
         public static implicit operator int(byte aa)   // CS0556  
         // try the following line instead  
         // public static implicit operator int(iii aa)  
         {  
            return 0;  
         }  
      }  
  
      public static void Main()  
      {  
      }  
   }  
}