Partilhar via


'<membername>' é ambíguo nas interfaces herdadas '<interfacename1>' e '<interfacename2>'

A interface herda dois ou mais membros com o mesmo nome a partir de va?ias interfaces.

ID de erro: BC30685

Para corrigir este erro

  • Lance o valor à interface base que você deseja usar, por exemplo:

    Interface Left
        Sub MySub()
    End Interface
    
    Interface Right
        Sub MySub()
    End Interface
    
    Interface LeftRight
        Inherits Left, Right
    End Interface
    
    Module test
        Sub Main()
            Dim x As LeftRight
            ' x.MySub()  'x is ambiguous.
            CType(x, Left).MySub() ' Cast to base type.
            CType(x, Right).MySub() ' Call the other base type.
        End Sub
    End Module
    

Consulte também

Conceitos

Visão geral de interfaces