編譯器錯誤 CS1553
更新:2007 年 11 月
錯誤訊息
宣告無效; 請改用 'modifier operator <dest-type> (...' 語法
運算子的傳回型別必須緊接在參數清單之前,且「修飾詞」必須為 implicit 或 explicit。
下列範例會產生 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()
{
}
}