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

Paolo Molaro lupus@ximian.com
Sat, 17 Aug 2002 11:23:55 +0200


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