Compiler Error CS1554
Declaration is not valid; use '<type> operator op (...' instead
The return type of an overloaded operator must appear before the operator
keyword.
The following sample generates CS1554:
// CS1554.cs
class MyClass
{
public static operator ++ MyClass (MyClass f) // CS1554
// try the following line instead
// public static MyClass operator ++ (MyClass f)
{
return new MyClass ();
}
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: