Share via


컴파일러 오류 CS0678

업데이트: 2007년 11월

오류 메시지

'variable': 필드는 volatile이면서 readonly일 수 없습니다.
'variable': a field can not be both volatile and readonly

volatilereadonly 키워드는 함께 사용할 수 없습니다.

다음 샘플에서는 CS0678 오류가 발생하는 경우를 보여 줍니다.

// CS0678.cs
using System;

class TestClass
{
   private readonly volatile int i;   // CS0678
   // try the following line instead
   // private volatile int i;

   public static void Main()
   {
   }
}