컴파일러 오류 CS0563

업데이트: 2007년 11월

오류 메시지

이항 연산자의 매개 변수 중 하나는 포함하는 형식이어야 합니다.
One of the parameters of a binary operator must be the containing type

연산자 오버로드에 대한 메서드는 해당 지침에 따라 선언해야 합니다. 자세한 내용은 연산자 오버로드 샘플을 참조하십시오.

예제

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

// CS0563.cs
public class iii
{
    public static implicit operator int(iii x)
    {
        return 0;
    }
    public static implicit operator iii(int x)
    {
        return null;
    }
    public static int operator +(int aa, int bb)   // CS0563 
    // Use the following line instead:
    // public static int operator +(int aa, iii bb)    
    {
        return 0;
    }
    public static void Main()
    {
    }
}