컴파일러 오류 CS0555

업데이트: 2007년 11월

오류 메시지

사용자 정의 연산자는 바깥쪽 형식의 개체를 가져와서 바깥쪽 형식의 개체로 변환할 수 없습니다.
User-defined operator cannot take an object of the enclosing type and convert to an object of the enclosing type

포함 클래스의 값에 대한 사용자 변환은 사용할 수 없으므로 이러한 연산자가 필요하지 않습니다.

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

// CS0555.cs
public class MyClass
{
   // delete the following operator to resolve this CS0555
   public static implicit operator MyClass(MyClass aa)   // CS0555
   {
      return new MyClass();
   }

   public static void Main()
   {
   }
}