Hi,
the following code produces an error on the second-last line:
Interface Left
Sub op()
End Interface
Interface Right
Sub op(ByVal i As Integer)
End Interface
Public Interface LR
Inherits Left, Right
End Interface
Class Derived
Implements LR
Public Overloads Sub op() Implements Left.op
End Sub
Public Overloads Sub op(ByVal i As Integer) Implements Right.op
End Sub
End Class
Sub test()
Dim d As LR = New Derived
d.op() 'op' is ambiguous across the inherited interfaces 'Client.Left' and 'Client.Right'.
End Sub
I don't see what's ambiguous here. One operation has a parameter, and one does not have
a parameter, so there is no ambiguity. Interestingly, replacing the declaration of d with:
Dim d As Derived = New Derived
makes the error disappear. But I don't see why a call on a Derived would be
any less ambiguous than a call on an LR -- both have the same methods with the
same signatures.
Compiler bad?
Cheers,
Michi.