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

Miguel de Icaza miguel@ximian.com
15 Aug 2002 17:12:02 -0400


Hello,

> "Jeroen Frijters" <mono@jeroen.nu> writes:
> 
> > When I have a C# class that tries to implement an interface (created
> > with ILASM) that contains a static method, mcs gives an error saying
> > that I should implement the static method (which obviously doesn't make
> > sense).
> 
> Hi,
> 
> I don't understand what you're trying to do: static methods are not
> allowed on interfaces, that'd be an error CS0106.  MCS currently
> doesn't report that error but abort with a parsing error instead since
> its parser won't recognize `static' as a keyword if it's used on an
> interface method.

This is being discussed as well on the .NET mailing lists (maybe this
was posted there first, and then brought up here?).  Basically, C# does
not allow static interface declarations.

So we are fine reporting an error there.

Miguel