[Mono-list] mcs won't allow implementation of interfaces withstatic methods

Serge serge@wildwestsoftware.com
Sat, 17 Aug 2002 11:26:41 +0300


> Yeah, but since C# doesn't allow static members in interfaces, mcs
> should ignore them.

Valid point of course, but I'm curious about other similar situations.
For example, nested types in interfaces. It's not allowed in C# (CS0524: interfaces cannot declare types).
But it's allowed (currently) for C# code to use these types anyway, for example types defined by Java code, compiled with J#.
Should it be prohibited as well?

Sergey


----- Original Message ----- 
From: "Paolo Molaro" <lupus@ximian.com>
To: <mono-list@ximian.com>
Sent: Friday, August 16, 2002 4:42 PM
Subject: Re: [Mono-list] mcs won't allow implementation of interfaces withstatic methods


> On 08/16/02 Serge wrote:
> > > C# code won't be able to call them, so it should just ignore their
> > > existance.
> > 
> > It seems that at present, it's possible to _call_ those methods (without implementing interface).
> > But, MCS generates correct code, while CSC produces wrong binary
> > (something like 'pop' instead of a 'call') without reporting any errors.
> 
> Yeah, but since C# doesn't allow static members in interfaces, mcs
> should ignore them. It's nice that it gets the code right, but it should
> not allow the call in the first place, IMHO.
> 
> lupus
> 
> -- 
> -----------------------------------------------------------------
> lupus@debian.org                                     debian/rules
> lupus@ximian.com                             Monkeys do it better
>