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()
{
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: