description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Compiler Error CS1553 |
Compiler Error CS1553 |
07/20/2015 |
|
|
aec64251-b4ac-45c0-b143-7ebda138af6e |
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()
{
}
}