編譯器錯誤 CS0677
更新:2007 年 11 月
錯誤訊息
'variable': Volatile 欄位不能是型別 'type'
以 volatile 關鍵字宣告之欄位的型別必須是下列其中之一:
任何參考型別 (Reference Type)
任何指標型別 (在 unsafe 內容中)
sbyte、byte、short、ushort、int、uint、char、float、bool 等型別
根據上列任一型別所產生的列舉型別。
下列範例會產生 CS0677:
// CS0677.cs
class TestClass
{
private volatile long i; // CS0677
public static void Main()
{
}
}