[Mono-list] A question about interfaces
07 Feb 2004 11:58:10 +0100
When I was going to file a bug report, I found out this bug was already
reported: bug #53255.
Thanks Peter for checking it on csc.
El s=E1b, 07 de 02 de 2004 a las 04:20, Peter Wu escribi=F3:
> On Sat, Feb 07, 2004 at 02:44:48AM +0000, Rodolfo Campero wrote:
> > Hello all,
> > I have a question about interfaces. I tried to compile the following=20
> > program:
> > <demo code snipped>
> > but I got a CS0122 error:
> > interfaces.cs(16) error CS0122: `InterfaceTests.IBottom.Count' is=20
> > inaccessible due to its protection level
> > Compilation failed: 1 error(s), 0 warnings
> > I wonder why IBottom.Count is inaccessible, given the fact that neither=
> > ILeft nor IRight hide this property.
> > I've read the documentation, and in ECMA-334 C# Language Specification,=
> > section 20.1.2: Base interfaces, there is a similar example involving=20
> > IControl, ITextBox, IListBox and IComboBox, and the example states:
> > "the IComboBox interface above inherits members SetText and SetItems as=
> > well as Paint." In the example, Paint is defined in the basic interface=
> > (IControl).
> > And then in 20.2, "The members of an interface are the members inherite=
> > from the base interfaces and the members declared by the interface itse=
> > From 20.4.2: "When a class implements multiple interfaces that have the=
> > same base interface, there can be only one implementation of the base=20
> > interface."
> > Apparently the property Count in my example shouldn't be hidden in the=20
> > interface IBottom, yet I'm getting an error. Is this a bug in mcs or am=
> > missing something?
> Your code is compiled successfully under MS C# Compiler. I would think
> this is a bug in mono.