Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 865 Bytes

cs1553.md

File metadata and controls

34 lines (29 loc) · 865 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Compiler Error CS1553
Compiler Error CS1553
07/20/2015
CS1553
CS1553
aec64251-b4ac-45c0-b143-7ebda138af6e

Compiler Error CS1553

Declaration is not valid; use 'modifier operator <dest-type> (...' instead

The return type for a conversion operator must immediately precede the parameter list, and modifier is either implicit or explicit.

The following sample generates CS1553:

// CS1553.cs  
class MyClass  
{  
   public static int implicit operator (MyClass f)   // CS1553  
   // try the following line instead  
   // public static implicit operator int (MyClass f)  
   {  
      return 6;  
   }  
  
   public static void Main()  
   {  
   }  
}