Share via


컴파일러 오류 CS1554

업데이트: 2007년 11월

오류 메시지

선언이 잘못되었습니다. 대신 '<type> operator op (...'을 사용하십시오.
Declaration is not valid; use '<type> operator op (...' instead

사용자 정의 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()
   {
   }
}