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

Serge serge@wildwestsoftware.com
Sat, 17 Aug 2002 18:07:22 +0300


> Probably it's just a stupid limitation that
> should not be there _in the spec_ and the C# compiler writers didn't
> feel like enforcing such dumbness on their tool...

It's seems that this limitation is actually one of the CLS-compliance rules (Part I, 7.9.4 Interface Type Definition).
I think that one possible rationale for this limitation is COM-interoperability, so that CLS-compliant interfaces
map 1:1 to COM interfaces (instance-level contracts only)? Just a wild guess.
But I can't find nothing about nested types in interfaces, it appears (implicitly) that they are CLS-compliant.

Sergey



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


> On 08/17/02 Serge wrote:
> > > 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?
>
> Eh. Well, I guess that is an implementation glitch.
> I don't know the rationale for not allowing C# to create static members
> and subtypes in interfaces. Probably it's just a stupid limitation that
> should not be there _in the spec_ and the C# compiler writers didn't
> feel like enforcing such dumbness on their tool...
> Of course this is assuming the rationale for the limitation is not
> valid. It would be good if the MS and ECMA people could enlighten us on
> that.
>
> lupus
>
> --
> -----------------------------------------------------------------
> lupus@debian.org                                     debian/rules
> lupus@ximian.com                             Monkeys do it better
>