無法繼承介面 '<interfacename1>',因為它所繼承的介面 '<interfacename2>' 可能與某些型別引數的介面 '<interfacename3>' 相同

更新:2007 年 11 月

某個泛型介面會繼承自兩個以上的泛型介面,並且其中兩個繼承的型別引數特定值可能會相衝突。

下列陳述式可能產生此錯誤。

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

如果提供相同型別給 t1 和 t2,而建構或實作 derivedInterface 時,則它必須繼承具相同型別引數之 interfaceX 的兩個版本。這樣做會造成存取版本的模稜兩可。

錯誤 ID:BC32121

若要修正這個錯誤

  • 變更其中一個提供給衍生介面的型別引數,以避免衝突。

    - 或 -

  • 從 Inherits 陳述式移除其中一個造成潛在繼承或實作衝突的介面。

請參閱

概念

介面概觀

繼承基本概念

Visual Basic 中的泛型型別

參考

Interface 陳述式 (Visual Basic)

Inherits 陳述式