编译器错误 CS1554
更新:2007 年 11 月
错误消息
声明无效;请改用“<type> operator op (...”
用户定义的 operator 的返回类型必须出现在关键字运算符之前。
下面的示例生成 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()
{
}
}