[nem-bug] [Nemerle 0000996]: lack of checks when "implements" is used

feedback at nemerle.org feedback at nemerle.org
Mon Apr 30 13:54:23 CEST 2007


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=996> 
======================================================================
Reported By:                divan
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   996
Category:                   Compiler
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             04-30-2007 11:39 CEST
Last Modified:              04-30-2007 13:54 CEST
======================================================================
Summary:                    lack of checks when "implements" is used
Description: 
interface IDo {
  Do() : void;
}

class A : IDo {
  public //it's ok to be public
  //private //compiles, but shouldn't?
  //internal //compiles, fails PEVerify check
  Do() : void implements IDo.Do {
  }
}

Should be E: "method implementing interface member must be public and
nonstatic", for private and internal case.
======================================================================

----------------------------------------------------------------------
 nazgul - 04-30-07 11:43 
----------------------------------------------------------------------
The purpose of implements is to implement interfaces using private (limited
methods). The only case where it is invalid is static methods.

If internal fails to verify, then it is either bug/limitation of MS
verifier and we should maybe somehow workaround the problem.

----------------------------------------------------------------------
 malekith - 04-30-07 11:45 
----------------------------------------------------------------------
I suspect this is because the method is also called Do. Could you try to
rename it?

----------------------------------------------------------------------
 divan - 04-30-07 11:52 
----------------------------------------------------------------------
Renamed it to Doo, no changes.
Don't know if it works on Mono, but for internal case compiled program
doesn't run on windows, gives:
 Unhandled Exception: System.TypeLoadException: Method 'Doo' in type 'A'
from assembly 'out, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
does not have an implementation.
   at Program.Main()

Also i've just tried protected: compiles, fails PEVerify, runs ok.

----------------------------------------------------------------------
 VladD2 - 04-30-07 13:49 
----------------------------------------------------------------------
It's not a bug. We should close it.

----------------------------------------------------------------------
 nazgul - 04-30-07 13:54 
----------------------------------------------------------------------
It would be good to investigate and many report to MS as a bug. 

I guess we should try to prevent generating non-verifying programs

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-30-07 11:39 divan          New Issue                                    
04-30-07 11:43 nazgul         Note Added: 0001857                          
04-30-07 11:45 malekith       Note Added: 0001858                          
04-30-07 11:52 divan          Note Added: 0001859                          
04-30-07 13:49 VladD2         Note Added: 0001863                          
04-30-07 13:54 nazgul         Note Added: 0001864                          
======================================================================




More information about the bugs mailing list