Also, if you start implementing things outside of CLS, think about the impact on other 
languages.  Eg, what will happen if you class is instanciated by Eiffel?  or Fortran? 
:)
 
/Brad

        -----Original Message----- 
        From: John Norwood 
        Sent: Wed 8/14/2002 11:02 AM 
        To: [EMAIL PROTECTED] 
        Cc: 
        Subject: Re: [DOTNET-ROTOR] C# compiler cannot handle interfaces with static 
methods
        
        

        It's been pointed out to me that I should probably rephrase the part 
        about CLS compliance. 

        Because the CLS does not support static methods on interfaces, there is 
        no CLS-based requirement that C# support them although C# can and does 
        support functionality outside the CLS. 

        Since the CLS does not require support and the spec specifically states 
        that they are not supported, what we are discussing now is preferred 
        behavior in the case of encountering functionality outside the supported 
        bounds. 

        Are you objecting to the current behavior or the proposed behavior?  I'm 
        not sure if when you state that C# should be able to support classes 
        that implement interfaces with static methods you mean fully support 
        (including static methods) or simply allow implementation ignoring the 
        static methods. 

        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 11:40 PM 
        To: [EMAIL PROTECTED] 
        Subject: Re: C# compiler cannot handle interfaces with static methods 


        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 
        > 



Reply via email to