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

Paolo Molaro lupus@ximian.com
Fri, 16 Aug 2002 11:43:44 +0200

On 08/16/02 Jeroen Frijters wrote:
> I disagree, while C# doesn't allow static interface declarations, that
> doesn't mean C# should be unable to implement interfaces from other
> languages that do add static methods to interfaces. There is nothing in
> the C# language specification that forbids that. You don't support
> static methods in interfaces, so just ignore them. Besides, the current
> error message is incorrect, fixing the compiler is less effort than
> fixing the error message ;-)

I agree with Jeroen here: C# can't use all the features in mscorlib
(for example the varargs methods in System.String and System.Console),
still it can use the other methods provided by those classes.
The issue is exactly the same for static methods in interfaces:
C# code won't be able to call them, so it should just ignore their
existance. Of course, the C# compiler can't generate them, too:
if somebody wants static members in interfaces he'll have to do them in
IL code or whatever language allows him to do that.

BTW: the mono runtime will need a small fix to allow static data on
interfaces, I'll do that when someone posts a sample in bugzilla.


lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better