Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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()
{
}
}
.NET feedback
.NET is an open source project. Select a link to provide feedback: