[nem-bug] [Nemerle 0000715]: Cannot implement interface when interface already implemented on base class

feedback at nemerle.org feedback at nemerle.org
Tue Jul 11 23:05:01 CEST 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=715> 
======================================================================
Reported By:                Snaury
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   715
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             07-11-2006 23:02 CEST
Last Modified:              07-11-2006 23:05 CEST
======================================================================
Summary:                    Cannot implement interface when interface already
implemented on base class
Description: 
The following code produces error: no interface implemented by `Something2'
contains method named `DoSomething' (looking for `ISomething.DoSomething')

using System;

public interface ISomething
{
  DoSomething() : void;
}

public class Something: ISomething
{
  ISomething_DoSomething() : void implements ISomething.DoSomething
  {
    Console.WriteLine("Something.DoSomething");
  }
}

public class Something2: Something, ISomething
{
  ISomething_DoSomething() : void implements ISomething.DoSomething
  {
    Console.WriteLine("Something2.DoSomething");
  }
}

public static class Program
{
  public static Main() : void
  {
    ((Something() : ISomething)).DoSomething();
    ((Something2() : ISomething)).DoSomething();
  }
}
======================================================================

----------------------------------------------------------------------
 Snaury - 07-11-06 23:05 
----------------------------------------------------------------------
It can be worked around when you write:

public class Something2: ISomething, Something

However, it is surprising that it works one way but not the other, besides
C# teaches that base class should always come first and then the
interfaces.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
07-11-06 23:02 Snaury         New Issue                                    
07-11-06 23:05 Snaury         Note Added: 0001362                          
======================================================================




More information about the bugs mailing list