다음을 통해 공유


'<interfacename1>' 인터페이스를 상속할 수 없습니다. 이 인터페이스가 일부 형식 인수에 대해 '<interfacename3>' 인터페이스가 상속된 '<interfacename2>' 인터페이스와 동일할 수 있습니다.

업데이트: 2007년 11월

Cannot inherit interface '<interfacename1>' because it could be identical to interface '<interfacename2>' from which the interface '<interfacename3>' inherits for some type arguments

제네릭 인터페이스는 두 개 이상의 제네릭 인터페이스에서 상속되며 이렇게 상속된 제네릭 인터페이스 중 두 개가 형식 인수의 특정 값에 대해 충돌할 수 있습니다.

다음 문을 실행하면 이 오류가 발생할 수 있습니다.

Public Interface interfaceA(Of u)
End Interface
Public Interface interfaceX(Of v)
    Inherits interfaceA(Of v)
End Interface
Public Interface derivedInterface(Of t1, t2)
    Inherits interfaceA(Of t1), interfaceX(Of t2)
End Interface

derivedInterface가 t1 및 t2 모두에 대해 동일한 형식을 제공하도록 생성되거나 구현되면 형식 인수가 동일한 두 버전의 interfaceA를 상속해야 합니다. 따라서 액세스해야 할 버전을 정확하게 식별할 수 없을 수 있습니다.

오류 ID: BC32123

이 오류를 해결하려면

  • 충돌을 방지하기 위해 파생 인터페이스에 제공된 형식 인수 중 하나를 변경합니다.

    - 또는 -

  • Inherits 문에서 상속 또는 구현 충돌 가능성이 있는 인터페이스 중 하나를 제거합니다.

참고 항목

개념

인터페이스 개요

상속 기본 사항

Visual Basic의 제네릭 형식

참조

Interface 문(Visual Basic)

Inherits 문