Hi John, I know that static methods in interfaces are not CLS and that the C# language spec doesn't allow them. I have no problem with C# not being able to call static methods on interfaces, but I do have a problem with not being able to implement interfaces with static methods (in particular .cctor), that IMHO is a (serious) bug.
Regards, Jeroen > -----Original Message----- > From: Discussion of the Rotor Shared Source CLI > implementation [mailto:[EMAIL PROTECTED]] On > Behalf Of John Norwood > Sent: Tuesday, August 13, 2002 23:53 > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET-ROTOR] C# compiler cannot handle > interfaces with static methods > > > Hi Jeroen, > > The C# spec explicitly states that the language does not > support static > members in interfaces (section 13.2, last sentence of first paragraph > after the grammar). > > Also note that an interface containing a static method is not CLS > compliant, so C# is not required to support them. In particular, you > cannot call one. > > However the .NET Framework v1 implementation (and the SSCLI > implementation) doesn't have the most crisply defined outcome in this > case (which you've uncovered) and "odd things" occur under in this > situation. There's a bug entered against this and the proposed fix > would be to simply ignore all static methods in interfaces that it > imports. This behavior is consistent with what happens when C# > encounters fields in interfaces. > > John > > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > -----Original Message----- > From: Jeroen Frijters [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 13, 2002 1:10 AM > To: [EMAIL PROTECTED] > Subject: BUG: C# compiler cannot handle interfaces with static methods > > > There are multiple bugs in the C# compiler wrt interfaces that contain > static methods: > - interfaces containing static methods cannot be implemented > (clr\src\csharp\csharp\sccomp\clsdrec.cpp line 5090 should have: if > (member->asMETHSYM()->isStatic) continue;) > - calls to static methods in interfaces are compiled incorrectly > - static methods in implemented interfaces are not visible in > the class > that implements the interface > > Regards, > Jeroen >