컴파일러 오류 CS0695

업데이트: 2007년 11월

오류 메시지

'generic interface'과(와) 'generic interface'은(는) 일부 형식 매개 변수를 대체할 때 통합될 수 있으므로 'generic type'은(는) 둘을 함께 구현할 수 없습니다.
'generic type' cannot implement both 'generic interface' and 'generic interface' because they may unify for some type parameter substitutions

이 오류는 제네릭 클래스에서 동일한 제네릭 인터페이스의 매개 변수화를 여러 번 구현하고 두 인터페이스를 동일하게 하는 형식 매개 변수 대체가 있는 경우에 발생합니다. 이 오류가 발생하지 않도록 하려면 인터페이스 중 하나만 구현하거나 충돌을 피하도록 형식 매개 변수를 변경합니다.

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

// CS0695.cs
// compile with: /target:library

interface I<T>
{
}

class G<T1, T2> : I<T1>, I<T2>  // CS0695
{
}